-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
33 lines (27 loc) · 983 Bytes
/
Copy pathwebpack.config.js
File metadata and controls
33 lines (27 loc) · 983 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
const webpack = require("@nativescript/webpack");
const VueLoaderPlugin = require("vue-loader/lib/plugin");
module.exports = (env) => {
webpack.init(env);
webpack.useConfig("vue");
webpack.chainWebpack((config) => {
config.resolve.alias.set("vue$", "nativescript-vue");
config.resolve.set('fallback', { url: false });
// Fix: Remove problematic workers rule
if (config.module.rules.has('workers')) {
config.module.rules.delete('workers');
}
// Replace the default VueLoaderPlugin (Vue 3) with the Vue 2 one
config.plugins.delete('VueLoaderPlugin');
config.plugin('VueLoaderPlugin').use(VueLoaderPlugin);
// Override the vue rule to use the project's vue-loader (v15)
config.module
.rule('vue')
.test(/\.vue$/)
.use('vue-loader')
.loader(require.resolve('vue-loader'))
.options({
compiler: require('nativescript-vue-template-compiler')
});
});
return webpack.resolveConfig();
};