1 Star 0 Fork 0

闫炳雨/myapp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
webpack.config.js 1006 Bytes
一键复制 编辑 原始数据 按行查看 历史
闫炳雨 提交于 2023-08-31 08:49 . 添加git配置文件
// const path = require('path')
// module.exports = {
// // mode: 'production',//默认打包模式(代码会被压缩)
// mode: 'development',//代码不会被压缩
// entry: {
// main: './app.js'
// },
// output: {
// filename: 'index.js',
// path: path.resolve(__dirname, 'dist')
// }
// }
const path = require('path');
const webpackNodeExternals = require('webpack-node-externals');
module.exports = {
target: 'node',
entry: './app.js', // 入口文件
output: {
path: path.resolve(__dirname, 'dist'), // 打包输出的目录
filename: 'bundle.js' // 打包输出的文件名
},
externals: [webpackNodeExternals()], // 忽略 node_modules 目录下的模块
module: {
rules: [
{
// test: /\.js$/, // 匹配 .js 文件
use: {
loader: 'babel-loader', // 使用 babel-loader 编译 ES6 语法
options: {
presets: ['@babel/preset-env']
}
}
}
]
}
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xiaoyu-loves/myapp.git
[email protected]:xiaoyu-loves/myapp.git
xiaoyu-loves
myapp
myapp
master

搜索帮助