UNPKG

1.38 kBJavaScriptView Raw
1const webpack = require('webpack');
2const webpackConfig = require('./webpack.config.js');
3const path = require('path');
4const {CleanWebpackPlugin} = require('clean-webpack-plugin');
5
6module.exports = {
7 mode: 'development',
8 cache: true,
9 entry: webpackConfig.entry,
10 output: webpackConfig.output,
11 resolve: webpackConfig.resolve,
12 module: {
13 rules: [
14 {
15 test: /\.js$/,
16 include: path.join(__dirname, 'src'),
17 exclude: /tablefilter\/node_modules/,
18 loader: 'isparta-loader'
19 }
20 ]
21 // TODO: re-instate StringReplacePlugin, currently failing
22 // in conjunction with 'isparta-loader'
23 },
24 devtool: 'source-map',
25 plugins: [
26 new CleanWebpackPlugin({
27 cleanOnceBeforeBuildPatterns: [path.join(process.cwd(), 'dist')]
28 }),
29 new webpack.LoaderOptionsPlugin({
30 debug: true,
31 options: {
32 isparta: {
33 embedSource: true,
34 noAutoWrap: true,
35 babel: {
36 compact: false,
37 presets: ['env'],
38 plugins: [['transform-es2015-classes', {loose: true}]]
39 }
40 }
41 }
42 })
43 ]
44};