aboutsummaryrefslogtreecommitdiffstats
path: root/config/webpack/environment.js
blob: 7a96539f168db6d3528a24288d6cdeed54615dcc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const { environment } = require('@rails/webpacker')
const CleanWebpackPlugin = require('clean-webpack-plugin')

let pathsToClean = [
  'public/packs'
];

// the clean options to use
let cleanOptions = {
  root: __dirname + '/../../',
  verbose: true,
  dry: false
};


environment.plugins.set(
  'CleanWebpack',
  new CleanWebpackPlugin(pathsToClean, cleanOptions)
)

// environment.plugins.set('Provide', new webpack.ProvidePlugin({
//     $: 'jquery',
//     jQuery: 'jquery',
//     jquery: 'jquery'
//   })
// )

// const config = environment.toWebpackConfig()

// config.resolve.alias = {
//   jquery: "jquery/src/jquery",
// }

module.exports = environment