-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.renderer.config.js
43 lines (38 loc) · 1.3 KB
/
webpack.renderer.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
37
38
39
40
41
42
43
const rules = require('./webpack.rules')
const path = require('path')
const { VueLoaderPlugin } = require('vue-loader')
const { DefinePlugin } = require('webpack')
const plugins = [
// Apply webpack rules to the corresponding language blocks in .vue files
new VueLoaderPlugin(),
// Set a few Vue 3 options; see: http://link.vuejs.org/feature-flags
new DefinePlugin({
__VUE_OPTIONS_API__: true,
__VUE_PROD_DEVTOOLS__: false
})
]
rules.push({
test: /\.less$/,
use: [{
loader: 'style-loader' // Create style nodes from JS strings
}, {
loader: 'css-loader' // Translate CSS into JS string
}]
})
module.exports = {
module: { rules },
// The following line of code serves two purposes: While we're in develop
// (NODE_ENV = develop), emit source maps so we have an easy time finding the
// origin of bugs or performance bottlenecks. But since source maps are a
// whopping 60MB large at the time of writing (July 2021), we disable these
// in production (i.e. when we ship to users). NOTE, however, that these env-
// variables must be set, which we're doing using cross-env in package.json.
devtool: (process.env.NODE_ENV === 'production') ? false : 'source-map',
plugins,
resolve: {
extensions: [
'.js', '.ts', '.jsx', '.tsx',
'.css', '.less', '.vue'
]
}
}