This repository has been archived on 2022-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
IcyNet.eu/webpack.common.js

56 lines
1.2 KiB
JavaScript
Raw Normal View History

2017-12-04 18:20:53 +00:00
const path = require('path')
2020-01-28 20:27:24 +00:00
const VueLoaderPlugin = require('vue-loader/lib/plugin')
2017-12-04 18:20:53 +00:00
module.exports = {
entry: {
main: './src/script/main.js',
admin: './src/script/admin.js'
},
output: {
path: path.join(__dirname, 'build', 'script'),
filename: '[name].js'
},
resolve: {
alias: {
2020-05-28 18:30:21 +00:00
vue$: 'vue/dist/vue.esm.js' // 'vue/dist/vue.common.js' for webpack 1
},
fallback: {
querystring: require.resolve('querystring-es3')
2017-12-04 18:20:53 +00:00
}
},
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: [
2020-01-28 20:27:24 +00:00
'@babel/preset-env'
2017-12-04 18:20:53 +00:00
],
plugins: [
2020-01-28 20:27:24 +00:00
'@babel/plugin-transform-modules-commonjs'
2017-12-04 18:20:53 +00:00
]
}
}
2017-12-04 20:33:44 +00:00
},
{
test: /\.vue$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'vue-loader'
}
2020-01-28 20:27:24 +00:00
},
{
test: /\.pug$/,
exclude: /(node_modules|bower_components)/,
loader: 'pug-plain-loader'
2017-12-04 18:20:53 +00:00
}
]
},
2020-01-28 20:27:24 +00:00
plugins: [
new VueLoaderPlugin()
]
2017-12-04 18:20:53 +00:00
}