40 lines
772 B
JavaScript
40 lines
772 B
JavaScript
'use strict'
|
|
|
|
const webpack = require('webpack')
|
|
const path = require('path')
|
|
|
|
module.exports = {
|
|
entry: {
|
|
main: './src/js/main'
|
|
},
|
|
output: {
|
|
path: path.join(__dirname, 'dist', 'js'),
|
|
filename: '[name].js'
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.js$/,
|
|
exclude: /(node_modules|bower_components)/,
|
|
use: {
|
|
loader: 'babel-loader',
|
|
options: {
|
|
presets: [ '@babel/preset-env' ]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
test: /src\/style\/.+\.styl$/,
|
|
loader: 'file-loader?name=./dist/style/[name].css!css-loader!stylus-loader'
|
|
}
|
|
]
|
|
},
|
|
plugins: [
|
|
new webpack.ProvidePlugin({
|
|
// Detect and inject
|
|
_: 'underscore'
|
|
})
|
|
],
|
|
devtool: 'inline-source-map'
|
|
}
|