forked from brianvoe/slim-select
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
36 lines (33 loc) · 958 Bytes
/
webpack.config.js
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
var projectRoot = process.cwd()
var path = require('path')
// Overriding default base webpack config
var config = {
entry: {
index: './docs/index.js'
},
resolve: {
// Aliases - Used for pointing to reusable parts of your app
alias: {
'src': projectRoot + '/src',
'docs': projectRoot + '/src/docs',
'images': projectRoot + '/src/docs/assets/images',
'scss': projectRoot + '/src/docs/assets/scss',
'slim-select': projectRoot + '/src/slim-select'
}
}
}
if (process.env.DOCS) {
config.output = {
path: path.resolve(projectRoot, 'docs'),
filename: '[name].js',
publicPath: '/'
}
} else if (process.env.ENVIRONMENT === 'production') {
config.entry.index = './slim-select/index.ts' // Only used because otherwise vue-build yells at me
config.entry.slimselect = './slim-select/index.ts'
config.output = {
library: 'SlimSelect',
libraryTarget: 'umd'
}
}
module.exports = config