forked from CartoDB/cartodb
-
Notifications
You must be signed in to change notification settings - Fork 1
/
vue.config.js
65 lines (64 loc) · 1.89 KB
/
vue.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
const webpack = require('webpack');
const path = require('path');
const { http_path_prefix } = require(`./config/grunt_${process.env.NODE_ENV}.json`);
const { version } = require('./package.json');
module.exports = {
runtimeCompiler: true,
transpileDependencies: ['@mapbox/martini', 'd3-array', 'd3-scale'],
publicPath: '/spatial-data-catalog/browser/',
outputDir: path.resolve(__dirname, `public/assets/${version}/javascripts`),
configureWebpack: {
resolve: {
alias: {
'do-catalog': path.resolve(__dirname, 'lib/assets/javascripts/do-catalog/'),
'tilesets-viewer': path.resolve(__dirname, 'lib/assets/javascripts/tilesets-viewer/'),
'new-dashboard': path.resolve(__dirname, 'lib/assets/javascripts/new-dashboard/')
},
extensions: ['.js', '.vue', '.json', '.scss']
},
performance: {
maxEntrypointSize: 2048000,
maxAssetSize: 2048000
},
module: {
rules: [
{
test: /\.vue$/,
use: [
{
loader: 'vue-svg-inline-loader'
}
]
}
]
},
plugins: [
new webpack.DefinePlugin({
__ASSETS_DIR__: JSON.stringify(`${http_path_prefix}/assets/${version}`)
})
]
},
css: {
extract: false,
loaderOptions: {
scss: {
data: "@import 'do-catalog/main.scss';"
}
}
},
chainWebpack: config => {
config.module.rule('js')
.use('babel-loader').loader('babel-loader');
if (process.env.NODE_ENV === 'production') {
config.module.rule('images').use('url-loader')
.loader('file-loader')
.tap(options => Object.assign(options, {
name: '../images/do-catalog/[name].[hash:8].[ext]'
}));
config.module.rule('svg').use('file-loader')
.tap(options => Object.assign(options, {
name: '../images/do-catalog/[name].[hash:8].[ext]'
}));
}
}
};