+20
-1
@@ -3,6 +3,7 @@ const fs = require('fs');
|
||||
const webpack = require('webpack');
|
||||
const SymlinkWebpackPlugin = require('symlink-webpack-plugin');
|
||||
const { VueLoaderPlugin } = require('vue-loader');
|
||||
const CopyPlugin = require("copy-webpack-plugin");
|
||||
|
||||
const ROOT = path.resolve(__dirname, '..');
|
||||
const SRC = path.resolve(ROOT, 'src');
|
||||
@@ -58,6 +59,13 @@ module.exports = (env, argv) => {
|
||||
rules: [{
|
||||
test: /\.vue$/,
|
||||
loader: 'vue-loader'
|
||||
}, {
|
||||
test: /\.mjs$/,
|
||||
include: /node_modules\/maplibre-gl/,
|
||||
parser: {
|
||||
exprContextCritical: false, // Silences expression context warnings [2]
|
||||
unknownContextCritical: false // Silences unknown context warnings
|
||||
}
|
||||
}, {
|
||||
test: /\.js$/,
|
||||
exclude: file => (/node_modules/.test(file) && !/\.vue\.js/.test(file)),
|
||||
@@ -94,7 +102,8 @@ module.exports = (env, argv) => {
|
||||
generator: {
|
||||
filename: isDev ? 'assets/images/[name][ext]' : 'assets/images/[name].[contenthash:8][ext]'
|
||||
}
|
||||
}]
|
||||
}
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new SymlinkWebpackPlugin([
|
||||
@@ -102,6 +111,12 @@ module.exports = (env, argv) => {
|
||||
{ origin: '../resources/geo/', symlink: 'geo' },
|
||||
{ origin: '../src/images/icons/', symlink: 'assets/images/icons' }
|
||||
]),
|
||||
new CopyPlugin({
|
||||
patterns: [{
|
||||
from: "node_modules/maplibre-gl/dist/maplibre-gl-(worker|shared).mjs",
|
||||
to: "maplibre/[name][ext]"
|
||||
}]
|
||||
}),
|
||||
new webpack.DefinePlugin({
|
||||
__VUE_OPTIONS_API__: 'true',
|
||||
__VUE_PROD_DEVTOOLS__: 'false',
|
||||
@@ -134,6 +149,10 @@ module.exports = (env, argv) => {
|
||||
'@scripts': path.resolve(SRC, 'scripts'),
|
||||
'@styles': path.resolve(SRC, 'styles')
|
||||
}
|
||||
},
|
||||
stats: {
|
||||
children: true,
|
||||
errorDetails: true
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user