11 Star 90 Fork 8

Gitee 极速下载 / wenyan-lang

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/LingDong-/wenyan-lang
克隆/下载
webpack.base.config.js 1.42 KB
一键复制 编辑 原始数据 按行查看 历史
antfu 提交于 2020-01-15 23:24 . chore: d.ts build
const path = require('path')
const dts = require('dts-bundle');
const defaultPlugins = () => [
new (require('remove-strict-webpack-plugin'))()
]
const baseConfig = () => {
return {
devtool: 'source-map',
output: {
globalObject: '(typeof self !== "undefined" ? self : this)', // make it works for both node and browser
libraryTarget: 'umd2',
library: ["Wenyan", "[name]"],
path: path.resolve(__dirname, 'dist'),
filename: '[name]/index.min.js',
},
plugins: defaultPlugins(),
resolve: {
extensions: ['.ts', '.js'],
},
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
{
test: /\.wy$/i,
use: 'raw-loader',
},
],
},
}
};
var DtsBundlePlugin = (function () {
const dts = require('dts-bundle');
function DtsBundlePlugin(options){
if (options === void 0) { options = {}; }
this.options = options;
}
function _bundle(options) {
return () => dts.bundle(options);
}
DtsBundlePlugin.prototype.apply = function (compiler) {
const bundle = () => _bundle(this.options);
if (!!compiler.hooks) {
compiler.hooks.afterEmit.tap('DtsBundlePlugin', bundle());
} else {
compiler.plugin('done', bundle());
}
};
return DtsBundlePlugin;
})();
module.exports = {
baseConfig,
defaultPlugins,
DtsBundlePlugin
}
JavaScript
1
https://gitee.com/mirrors/wenyan-lang.git
git@gitee.com:mirrors/wenyan-lang.git
mirrors
wenyan-lang
wenyan-lang
master

搜索帮助