2018-10-06 17:57:53 +00:00
|
|
|
const path = require('path')
|
2019-07-14 15:57:46 +00:00
|
|
|
const webpack = require('webpack')
|
2018-10-06 17:57:53 +00:00
|
|
|
|
2019-05-10 21:12:00 +00:00
|
|
|
const VueLoaderPlugin = require('vue-loader/lib/plugin')
|
|
|
|
|
2018-10-06 17:57:53 +00:00
|
|
|
module.exports = {
|
2019-05-10 21:12:00 +00:00
|
|
|
entry: './main.js',
|
2018-10-06 17:57:53 +00:00
|
|
|
output: {
|
|
|
|
filename: 'app.js',
|
2019-07-14 15:57:46 +00:00
|
|
|
path: path.resolve(__dirname, '..', 'frontend'),
|
2018-10-06 17:57:53 +00:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
'process.env': {
|
2019-07-14 15:57:46 +00:00
|
|
|
NODE_ENV: JSON.stringify('production'),
|
|
|
|
},
|
2019-05-10 21:12:00 +00:00
|
|
|
}),
|
|
|
|
new VueLoaderPlugin(),
|
2018-10-06 17:57:53 +00:00
|
|
|
],
|
|
|
|
optimization: {
|
2019-07-14 15:57:46 +00:00
|
|
|
minimize: true,
|
2018-10-06 17:57:53 +00:00
|
|
|
},
|
|
|
|
module: {
|
2019-05-10 21:12:00 +00:00
|
|
|
rules: [
|
|
|
|
|
|
|
|
{
|
2018-10-06 17:57:53 +00:00
|
|
|
test: /\.(s?)css$/,
|
|
|
|
use: [
|
|
|
|
'style-loader',
|
|
|
|
'css-loader',
|
|
|
|
'sass-loader',
|
|
|
|
],
|
|
|
|
},
|
2019-05-10 21:12:00 +00:00
|
|
|
|
2018-10-06 17:57:53 +00:00
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
exclude: /(node_modules|bower_components)/,
|
|
|
|
use: {
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
2021-09-06 19:05:48 +00:00
|
|
|
presets: [['@babel/preset-env', { targets: { browsers: ['>0.25%', 'not ie 11', 'not op_mini all'] } }]],
|
2019-07-14 15:57:46 +00:00
|
|
|
},
|
|
|
|
},
|
2018-10-06 17:57:53 +00:00
|
|
|
},
|
2019-05-10 21:12:00 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
test: /\.vue$/,
|
|
|
|
loader: 'vue-loader',
|
|
|
|
},
|
|
|
|
|
2021-09-26 12:49:18 +00:00
|
|
|
{
|
|
|
|
test: /\.woff2/,
|
|
|
|
type: 'asset/resource',
|
|
|
|
generator: {
|
|
|
|
filename: '[name][ext]',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2019-07-14 15:57:46 +00:00
|
|
|
],
|
|
|
|
},
|
2018-10-06 17:57:53 +00:00
|
|
|
}
|