加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
webpack.config.js 1.01 KB
一键复制 编辑 原始数据 按行查看 历史
Vilius 提交于 2019-06-22 21:13 . npm update (fixed vulnerabilities)
var webpack = require('webpack');
var path = require('path');
module.exports = {
entry: [
'babel-polyfill',
'./src/js/main.js',
],
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/dist/'
},
resolve: {
extensions: ['.js', '.css'],
alias: {
Utilities: path.resolve(__dirname, './../node_modules/')
}
},
module: {
rules: [
{
test: /\.css$/,
use: [
'style-loader',
{
loader: 'css-loader',
options: {url: false}
}
]
},
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['env']
}
}
},
]
},
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery"
}),
new webpack.DefinePlugin({
VERSION: JSON.stringify(require("./package.json").version)
}),
],
devtool: "cheap-module-source-map",
devServer: {
contentBase: "./",
compress: true,
}
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化