koel/webpack.config.js

48 lines
1 KiB
JavaScript
Raw Normal View History

2017-12-10 00:21:39 +00:00
const path = require('path')
2018-02-02 20:51:04 +00:00
const webpack = require('webpack')
2017-12-10 00:21:39 +00:00
module.exports = {
2018-02-02 20:51:04 +00:00
externals: {
2018-02-02 21:12:19 +00:00
electron: 'electron',
'vue-electron': 'vue-electron'
2018-02-02 20:51:04 +00:00
},
2017-12-10 00:21:39 +00:00
resolve: {
alias: {
2018-01-29 23:13:54 +00:00
'@': path.resolve(__dirname, 'resources/assets/js'),
'#': path.resolve(__dirname, 'resources/assets/sass')
2017-12-10 00:21:39 +00:00
}
},
2018-02-02 20:51:04 +00:00
plugins: [
new webpack.DefinePlugin({
2019-08-24 18:01:09 +00:00
KOEL_ENV: '"web"',
NODE_ENV: JSON.stringify(process.env.NODE_ENV || 'development')
2018-02-02 20:51:04 +00:00
})
],
2017-12-10 00:21:39 +00:00
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]?[hash]'
}
}
]
}
}
// test specific setups
if (process.env.NODE_ENV === 'test') {
module.exports.externals = [require('webpack-node-externals')()]
module.exports.devtool = 'inline-cheap-module-source-map'
}