forked from caiogondim/webpack-conditional-loader
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathwebpack.js
More file actions
37 lines (36 loc) · 899 Bytes
/
webpack.js
File metadata and controls
37 lines (36 loc) · 899 Bytes
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
35
36
37
const path = require('path')
const conditionalLoader = require('./src')
module.exports = {
entry: {
'env-var-truthy': './test/test-files/env-var-truthy.js',
'env-var-falsey': './test/test-files/env-var-falsey.js',
'local-var-truthy': './test/test-files/local-var-truthy.js',
'local-var-falsey': './test/test-files/local-var-falsey.js',
'falsey': './test/test-files/falsey.js',
'truthy': './test/test-files/truthy.js'
},
output: {
path: path.resolve(__dirname, 'build'),
filename: '[name].js',
libraryTarget: 'umd'
},
resolveLoader: {
alias: {
'conditional-loader': path.join(__dirname, './src')
}
},
module: {
rules: [{
test: /\.js$/,
use: [{
loader: 'conditional-loader',
options: {
localVar: {
truthy: true,
falsey: false
}
}
}]
}]
}
}