1
0
Fork 0
mirror of synced 2024-11-22 16:55:35 -05:00
ovpn-admin/frontend/webpack.config.js

71 lines
1.3 KiB
JavaScript
Raw Normal View History

2020-05-14 19:13:33 -04:00
var path = require('path')
var webpack = require('webpack')
2020-10-29 06:50:19 -04:00
const TerserPlugin = require('terser-webpack-plugin');
2020-05-14 19:13:33 -04:00
module.exports = {
mode: 'production',
entry: {
bundle: [
'./src/main.js',
],
style: [
'./src/style.js',
]
},
2020-05-14 19:13:33 -04:00
output: {
path: path.resolve(__dirname, './static/dist'),
publicPath: '/dist/',
filename: '[name].min.js'
2020-05-14 19:13:33 -04:00
},
module: {
rules: [
{
test: /\.css$/,
use: [
'vue-style-loader',
'css-loader'
],
},
2020-05-14 19:13:33 -04:00
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
}
2020-05-14 19:13:33 -04:00
]
},
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js'
},
extensions: ['*', '.js', '.vue', '.json']
},
devServer: {
historyApiFallback: true,
noInfo: true,
overlay: true
},
performance: {
hints: false
},
}
if (process.env.NODE_ENV === 'production') {
module.exports.devtool = 'false'
2020-05-14 19:13:33 -04:00
// http://vue-loader.vuejs.org/en/workflow/production.html
module.exports.plugins = (module.exports.plugins || []).concat([
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
2020-10-29 06:50:19 -04:00
new TerserPlugin({
sourceMap: false
2020-05-14 19:13:33 -04:00
}),
new webpack.LoaderOptionsPlugin({
minimize: true
})
])
}