outwatch-test/webpack.config.dev.js

47 lines
1.2 KiB
JavaScript
Raw Normal View History

2020-12-27 14:58:19 +00:00
var webpack = require('webpack');
var merge = require('webpack-merge');
var generated = require('./scalajs.webpack.config');
var Path = require('path');
2020-12-27 14:58:19 +00:00
const rootDir = Path.resolve(__dirname, '../../../..');
var local = {
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.(ttf|eot|woff|png|glb|jpeg|jpg|mp4|jsn)$/,
use: 'file-loader'
},
{
test: /\.(eot)$/,
use: 'url-loader'
}
]
},
devServer: {
contentBase: [
Path.resolve(__dirname, 'dev'), // fastOptJS output
Path.resolve(rootDir, 'assets') // project root containing index.html
],
watchContentBase: true,
hot: false,
hotOnly: false, // only reload when build is successful
inline: true, // live reloading
watchOptions: {
poll: 1000,
ignored: ["node_modules"]
}
},
plugins: [
new webpack.ProvidePlugin({
$: 'jquery/src/jquery',
jquery: 'jquery/src/jquery'
})
]
2020-12-27 14:58:19 +00:00
};
module.exports = merge(generated, local);