1 Star 0 Fork 0

jinyule/algorithm-visualizer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
webpack.backend.config.js 961 Bytes
一键复制 编辑 原始数据 按行查看 历史
Jason Park 提交于 2018-07-12 23:01 . Rename directory built to build
const CleanWebpackPlugin = require('clean-webpack-plugin');
const nodeExternals = require('webpack-node-externals');
const path = require('path');
const fs = require('fs');
const {
__DEV__,
backendBuildPath: buildPath,
backendSrcPath: srcPath,
} = require('./environment');
const alias = {
'/environment': path.resolve(__dirname, 'environment.js'),
};
fs.readdirSync(srcPath).forEach(name => {
alias['/' + name] = path.resolve(srcPath, name);
});
module.exports = {
target: 'node',
node: {
__dirname: true,
},
entry: srcPath,
externals: [nodeExternals()],
resolve: {
modules: [srcPath],
extensions: ['.js'],
alias,
},
output: {
path: buildPath,
filename: 'index.js',
libraryTarget: 'umd',
},
module: {
rules: [
{ test: /\.js$/, use: 'babel-loader', include: srcPath },
],
},
plugins: [
new CleanWebpackPlugin([buildPath]),
],
mode: __DEV__ ? 'development' : 'production',
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/jinyule/algorithm-visualizer.git
git@gitee.com:jinyule/algorithm-visualizer.git
jinyule
algorithm-visualizer
algorithm-visualizer
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385