aboutsummaryrefslogtreecommitdiffstats
path: root/config/webpack/environment.js
blob: 688bcbe8e52346a45d0195a0c42a45e2b73754f1 (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
const { environment } = require('@rails/webpacker')
const coffee =  require('./loaders/coffee')
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)
)

// const config = environment.toWebpackConfig()

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

environment.loaders.append('coffee', coffee)
module.exports = environment