koel/webpack.config.js

47 lines
957 B
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({
KOEL_ENV: '"web"'
})
],
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'
}