1 Star 0 Fork 0

MaJXm/m-deploy

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
webpack.config.js 1.47 KB
一键复制 编辑 原始数据 按行查看 历史
MaJXm 提交于 2020-11-26 16:18 . 新增eslint校验代码
const path = require('path')
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
const fs = require('fs');
// 拿出commonjs模块
const nodeModules = {};
fs.readdirSync('node_modules')
.filter( (catalogue) => {
return ['.bin'].indexOf(catalogue) === -1;
})
.forEach( (mod) => {
nodeModules[mod] = 'commonjs ' + mod;
});
module.exports = {
// mode: 'development',
mode: 'production',
entry: './src/index.js',
target: 'node',
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'lib'),
libraryTarget: 'commonjs2',
},
externals: nodeModules,
node: {
__filename: false,
__dirname: false,
path: 'empty',
fs: 'empty',
child_process: 'empty',
},
optimization: {
minimize: true,
},
context: __dirname,
module: {
noParse: /node-ssh/,
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: [
{
loader: 'babel-loader',
options: {
presets: [
[
'@babel/preset-env',
{
targets: {
node: true,
},
},
],
],
},
},
{
loader: 'eslint-loader',
options: {
formatter: require('eslint-friendly-formatter')
}
}
],
},
],
},
plugins: [new CleanWebpackPlugin()],
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/MaJXm21/m-deploy.git
git@gitee.com:MaJXm21/m-deploy.git
MaJXm21
m-deploy
m-deploy
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385