2019-05-06 17:49:25 +02:00
|
|
|
var path = require("path");
|
|
|
|
var webpack = require("webpack");
|
|
|
|
var css = require("mini-css-extract-plugin");
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
mode: "development",
|
|
|
|
entry: {
|
|
|
|
app: "./assets/app.js",
|
|
|
|
vendor: "./assets/vendor.js"
|
|
|
|
},
|
|
|
|
output: {
|
2019-05-06 18:26:50 +02:00
|
|
|
path: path.resolve(__dirname, "static/"),
|
|
|
|
filename: "[name].js"
|
2019-05-06 17:49:25 +02:00
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
2019-05-06 19:08:08 +02:00
|
|
|
use: ['babel-loader']
|
2019-05-06 17:49:25 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.scss$/,
|
|
|
|
use: [css.loader, 'css-loader', 'sass-loader']
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.less$/,
|
|
|
|
use: [css.loader, 'css-loader', 'less-loader']
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.css$/,
|
|
|
|
use: [css.loader, 'css-loader']
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.woff($|\?)|\.woff2($|\?)|\.ttf($|\?)|\.eot($|\?)|\.svg($|\?)/,
|
|
|
|
use: ['url-loader']
|
2019-07-08 18:19:09 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
// Exposes jQuery for use outside Webpack build
|
|
|
|
test: require.resolve('jquery'),
|
|
|
|
use: [{
|
|
|
|
loader: 'expose-loader',
|
|
|
|
options: 'jQuery'
|
|
|
|
}, {
|
|
|
|
loader: 'expose-loader',
|
|
|
|
options: '$'
|
|
|
|
}]
|
2019-05-06 17:49:25 +02:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new css({
|
|
|
|
filename: "[name].css",
|
|
|
|
chunkFilename: "[id].css"
|
|
|
|
}),
|
|
|
|
new webpack.ProvidePlugin({
|
|
|
|
$: "jquery",
|
|
|
|
jQuery: "jquery"
|
|
|
|
})
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|