I am pretty capable when it comes to wepack, so I expected to get this working. But , I am using vue 3 for the first time, and the webpack is .. different. You use a vue.config.js to set up a block to modify the webpack config with webpack-merge or webpack-chain. Since I want to mutate the ts loaders (I assumed), I used chain.. there's a few other configuration changes I have made, so my vue.config.ts looks like this:
{
mode: 'development',
context: '/Users/me/Public/project',
node: {
setImmediate: false,
process: 'mock',
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty'
},
output: {
path: '/Users/me/Public/project/dist',
filename: 'js/[name].js',
publicPath: '/',
chunkFilename: 'js/[name].js'
},
resolve: {
alias: {
'@': '/Users/me/Public/project/src',
vue$: 'vue/dist/vue.runtime.esm.js'
},
extensions: [
'.tsx',
'.ts',
'.mjs',
'.js',
'.jsx',
'.vue',
'.json',
'.wasm'
],
modules: [
'node_modules',
'/Users/me/Public/project/node_modules',
'/Users/me/Public/project/node_modules/@vue/cli-service/node_modules'
]
},
resolveLoader: {
modules: [
'/Users/me/Public/project/node_modules/@vue/cli-plugin-typescript/node_modules',
'/Users/me/Public/project/node_modules/@vue/cli-plugin-babel/node_modules',
'node_modules',
'/Users/me/Public/project/node_modules',
'/Users/me/Public/project/node_modules/@vue/cli-service/node_modules'
]
},
module: {
noParse: /^(vue|vue-router|vuex|vuex-router-sync)$/,
rules: [
/* config.module.rule('vue') */
{
test: /\.vue$/,
use: [
{
loader: '/Users/me/Public/project/node_modules/cache-loader/dist/cjs.js',
options: {
cacheDirectory: '/Users/me/Public/project/node_modules/.cache/vue-loader',
cacheIdentifier: '1fc0539f'
}
},
{
loader: '/Users/me/Public/project/node_modules/vue-loader/lib/index.js',
options: {
compilerOptions: {
whitespace: 'condense'
},
cacheDirectory: '/Users/me/Public/project/node_modules/.cache/vue-loader',
cacheIdentifier: '1fc0539f'
}
}
]
},
/* config.module.rule('images') */
{
test: /\.(png|jpe?g|gif|webp)(\?.*)?$/,
use: [
{
loader: '/Users/me/Public/project/node_modules/url-loader/dist/cjs.js',
options: {
limit: 4096,
fallback: {
loader: 'file-loader',
options: {
name: 'img/[name].[hash:8].[ext]'
}
}
}
}
]
},
/* config.module.rule('svg') */
{
test: /\.(svg)(\?.*)?$/,
use: [
{
loader: '/Users/me/Public/project/node_modules/file-loader/dist/cjs.js',
options: {
name: 'img/[name].[hash:8].[ext]'
}
}
]
},
/* config.module.rule('media') */
{
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
use: [
{
loader: '/Users/me/Public/project/node_modules/url-loader/dist/cjs.js',
options: {
limit: 4096,
fallback: {
loader: 'file-loader',
options: {
name: 'media/[name].[hash:8].[ext]'
}
}
}
}
]
},
/* config.module.rule('fonts') */
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/i,
use: [
{
loader: '/Users/me/Public/project/node_modules/url-loader/dist/cjs.js',
options: {
limit: 4096,
fallback: {
loader: 'file-loader',
options: {
name: 'fonts/[name].[hash:8].[ext]'
}
}
}
}
]
},
/* config.module.rule('pug') */
{
test: /\.pug$/,
oneOf: [
/* config.module.rule('pug').oneOf('pug-vue') */
{
resourceQuery: /vue/,
use: [
{
loader: 'pug-plain-loader'
}
]
},
/* config.module.rule('pug').oneOf('pug-template') */
{
use: [
{
loader: 'raw-loader'
},
{
loader: 'pug-plain-loader'
}
]
}
]
},
/* config.module.rule('css') */
{
test: /\.css$/,
oneOf: [
/* config.module.rule('css').oneOf('vue-modules') */
{
resourceQuery: /module/,
use: [
{
loader: '/Users/me/Public/project/node_modules/vue-style-loader/index.js',
options: {
sourceMap: false,
shadowMode: false
}
},
{
loader: '/Users/me/Public/project/node_modules/css-loader/dist/cjs.js',
options: {
sourceMap: false,
importLoaders: 2,
modules: {
localIdentName: '[name]_[local]_[hash:base64:5]'
}
}
},
{
loader: '/Users/me/Public/project/node_modules/postcss-loader/src/index.js',
options: {
sourceMap: false,
plugins: [
function () { /* omitted long function */ }
]
}
}
]
},
/* config.module.rule('css').oneOf('vue') */
{
resourceQuery: /\?vue/,
use: [
{
loader: '/Users/me/Public/project/node_modules/vue-style-loader/index.js',
options: {
sourceMap: false,
shadowMode: false
}
},
{
loader: '/Users/me/Public/project/node_modules/css-loader/dist/cjs.js',
options: {
sourceMap: false,
importLoaders: 2
}
},
{
loader: '/Users/me/Public/project/node_modules/postcss-loader/src/index.js',
options: {
sourceMap: false,
plugins: [
function () { /* omitted long function */ }
]
}
}
]
},
/* config.module.rule('css').oneOf('normal-modules') */
{
test: /\.module\.\w+$/,
use: [
{
loader: '/Users/me/Public/project/node_modules/vue-style-loader/index.js',
options: {
sourceMap: false,
shadowMode: false
}
},
{
loader: '/Users/me/Public/project/node_modules/css-loader/dist/cjs.js',
options: {
sourceMap: false,
importLoaders: 2,
modules: {
localIdentName: '[name]_[local]_[hash:base64:5]'
}
}
},
{
loader: '/Users/me/Public/project/node_modules/postcss-loader/src/index.js',
options: {
sourceMap: false,
plugins: [
function () { /* omitted long function */ }
]
}
}
]
},
/* config.module.rule('css').oneOf('normal') */
{
use: [
{
loader: '/Users/me/Public/project/node_modules/vue-style-loader/index.js',
options: {
sourceMap: false,
shadowMode: false
}
},
{
loader: '/Users/me/Public/project/node_modules/css-loader/dist/cjs.js',
options: {
sourceMap: false,
importLoaders: 2
}
},
{
loader: '/Users/me/Public/project/node_modules/postcss-loader/src/index.js',
options: {
sourceMap: false,
plugins: [
function () { /* omitted long function */ }
]
}
}
]
}
]
},
/* config.module.rule('postcss') */
{
test: /\.p(ost)?css$/,
oneOf: [
/* config.module.rule('postcss').oneOf('vue-modules') */
{
resourceQuery: /module/,
use: [
{
loader: '/Users/me/Public/project/node_modules/vue-style-loader/index.js',
options: {
sourceMap: false,
shadowMode: false
}
},
{
loader: '/Users/me/Public/project/node_modules/css-loader/dist/cjs.js',
options: {
sourceMap: false,
importLoaders: 2,
modules: {
localIdentName: '[name]_[local]_[hash:base64:5]'
}
}
},
{
loader: '/Users/me/Public/project/node_modules/postcss-loader/src/index.js',
options: {
sourceMap: false,
plugins: [
function () { /* omitted long function */ }
]
}
}
]
},
/* config.module.rule('postcss').oneOf('vue') */
{
resourceQuery: /\?vue/,
use: [
{
loader: '/Users/me/Public/project/node_modules/vue-style-loader/index.js',
options: {
sourceMap: false,
shadowMode: false
}
},
{
loader: '/Users/me/Public/project/node_modules/css-loader/dist/cjs.js',
options: {
sourceMap: false,
importLoaders: 2
}
},
{
loader: '/Users/me/Public/project/node_modules/postcss-loader/src/index.js',
options: {
sourceMap: false,
plugins: [
function () { /* omitted long function */ }
]
}
}
]
},
/* config.module.rule('postcss').oneOf('normal-modules') */
{
test: /\.module\.\w+$/,
use: [
{
loader: '/Users/me/Public/project/node_modules/vue-style-loader/index.js',
options: {
sourceMap: false,
shadowMode: false
}
},
{
loader: '/Users/me/Public/project/node_modules/css-loader/dist/cjs.js',
options: {
sourceMap: false,
importLoaders: 2,
modules: {
localIdentName: '[name]_[local]_[hash:base64:5]'
}
}
},
{
loader: '/Users/me/Public/project/node_modules/postcss-loader/src/index.js',
options: {
sourceMap: false,
plugins: [
function () { /* omitted long function */ }
]
}
}
]
},
/* config.module.rule('postcss').oneOf('normal') */
{
use: [
{
loader: '/Users/me/Public/project/node_modules/vue-style-loader/index.js',
options: {
sourceMap: false,
shadowMode: false
}
},
{
loader: '/Users/me/Public/project/node_modules/css-loader/dist/cjs.js',
options: {
sourceMap: false,
importLoaders: 2
}
},
{
loader: '/Users/me/Public/project/node_modules/postcss-loader/src/index.js',
options: {
sourceMap: false,
plugins: [
function () { /* omitted long function */ }
]
}
}
]
}
]
},
/* config.module.rule('scss') */
{
test: /\.scss$/,
oneOf: [
/* config.module.rule('scss').oneOf('vue-modules') */
{
resourceQuery: /module/,
use: [
{
loader: '/Users/me/Public/project/node_modules/vue-style-loader/index.js',
options: {
sourceMap: false,
shadowMode: false
}
},
{
loader: '/Users/me/Public/project/node_modules/css-loader/dist/cjs.js',
options: {
sourceMap: false,
importLoaders: 2,
modules: {
localIdentName: '[name]_[local]_[hash:base64:5]'
}
}
},
{
loader: '/Users/me/Public/project/node_modules/postcss-loader/src/index.js',
options: {
sourceMap: false,
plugins: [
function () { /* omitted long function */ }
]
}
},
{
loader: '/Users/me/Public/project/node_modules/sass-loader/dist/cjs.js',
options: {
sourceMap: false,
implementation: {
run_: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
render: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
renderSync: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
info: 'dart-sass\t1.24.0\t(Sass Compiler)\t[Dart]\ndart2js\t2.7.0\t(Dart Compiler)\t[Dart]',
types: {
Boolean: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
Color: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
List: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
Map: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
Null: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
Number: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
String: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
Error: function Error() { [native code] }
}
},
prependData: '@import "@/styles/global.scss";'
}
}
]
},
/* config.module.rule('scss').oneOf('vue') */
{
resourceQuery: /\?vue/,
use: [
{
loader: '/Users/me/Public/project/node_modules/vue-style-loader/index.js',
options: {
sourceMap: false,
shadowMode: false
}
},
{
loader: '/Users/me/Public/project/node_modules/css-loader/dist/cjs.js',
options: {
sourceMap: false,
importLoaders: 2
}
},
{
loader: '/Users/me/Public/project/node_modules/postcss-loader/src/index.js',
options: {
sourceMap: false,
plugins: [
function () { /* omitted long function */ }
]
}
},
{
loader: '/Users/me/Public/project/node_modules/sass-loader/dist/cjs.js',
options: {
sourceMap: false,
implementation: {
run_: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
render: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
renderSync: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
info: 'dart-sass\t1.24.0\t(Sass Compiler)\t[Dart]\ndart2js\t2.7.0\t(Dart Compiler)\t[Dart]',
types: {
Boolean: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
Color: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
List: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
Map: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
Null: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
Number: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
String: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
Error: function Error() { [native code] }
}
},
prependData: '@import "@/styles/global.scss";'
}
}
]
},
/* config.module.rule('scss').oneOf('normal-modules') */
{
test: /\.module\.\w+$/,
use: [
{
loader: '/Users/me/Public/project/node_modules/vue-style-loader/index.js',
options: {
sourceMap: false,
shadowMode: false
}
},
{
loader: '/Users/me/Public/project/node_modules/css-loader/dist/cjs.js',
options: {
sourceMap: false,
importLoaders: 2,
modules: {
localIdentName: '[name]_[local]_[hash:base64:5]'
}
}
},
{
loader: '/Users/me/Public/project/node_modules/postcss-loader/src/index.js',
options: {
sourceMap: false,
plugins: [
function () { /* omitted long function */ }
]
}
},
{
loader: '/Users/me/Public/project/node_modules/sass-loader/dist/cjs.js',
options: {
sourceMap: false,
implementation: {
run_: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
render: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
renderSync: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
info: 'dart-sass\t1.24.0\t(Sass Compiler)\t[Dart]\ndart2js\t2.7.0\t(Dart Compiler)\t[Dart]',
types: {
Boolean: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
Color: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
List: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
Map: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
Null: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
Number: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
String: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
Error: function Error() { [native code] }
}
},
prependData: '@import "@/styles/global.scss";'
}
}
]
},
/* config.module.rule('scss').oneOf('normal') */
{
use: [
{
loader: '/Users/me/Public/project/node_modules/vue-style-loader/index.js',
options: {
sourceMap: false,
shadowMode: false
}
},
{
loader: '/Users/me/Public/project/node_modules/css-loader/dist/cjs.js',
options: {
sourceMap: false,
importLoaders: 2
}
},
{
loader: '/Users/me/Public/project/node_modules/postcss-loader/src/index.js',
options: {
sourceMap: false,
plugins: [
function () { /* omitted long function */ }
]
}
},
{
loader: '/Users/me/Public/project/node_modules/sass-loader/dist/cjs.js',
options: {
sourceMap: false,
implementation: {
run_: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
render: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
renderSync: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
info: 'dart-sass\t1.24.0\t(Sass Compiler)\t[Dart]\ndart2js\t2.7.0\t(Dart Compiler)\t[Dart]',
types: {
Boolean: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
Color: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
List: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
Map: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
Null: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
Number: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
String: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
Error: function Error() { [native code] }
}
},
prependData: '@import "@/styles/global.scss";'
}
}
]
}
]
},
/* config.module.rule('sass') */
{
test: /\.sass$/,
oneOf: [
/* config.module.rule('sass').oneOf('vue-modules') */
{
resourceQuery: /module/,
use: [
{
loader: '/Users/me/Public/project/node_modules/vue-style-loader/index.js',
options: {
sourceMap: false,
shadowMode: false
}
},
{
loader: '/Users/me/Public/project/node_modules/css-loader/dist/cjs.js',
options: {
sourceMap: false,
importLoaders: 2,
modules: {
localIdentName: '[name]_[local]_[hash:base64:5]'
}
}
},
{
loader: '/Users/me/Public/project/node_modules/postcss-loader/src/index.js',
options: {
sourceMap: false,
plugins: [
function () { /* omitted long function */ }
]
}
},
{
loader: '/Users/me/Public/project/node_modules/sass-loader/dist/cjs.js',
options: {
sourceMap: false,
implementation: {
run_: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
render: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
renderSync: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
info: 'dart-sass\t1.24.0\t(Sass Compiler)\t[Dart]\ndart2js\t2.7.0\t(Dart Compiler)\t[Dart]',
types: {
Boolean: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
Color: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
List: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
Map: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
Null: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
Number: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
String: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
Error: function Error() { [native code] }
}
},
prependData: '@import "@/styles/global.scss";',
sassOptions: {
indentedSyntax: true
}
}
}
]
},
/* config.module.rule('sass').oneOf('vue') */
{
resourceQuery: /\?vue/,
use: [
{
loader: '/Users/me/Public/project/node_modules/vue-style-loader/index.js',
options: {
sourceMap: false,
shadowMode: false
}
},
{
loader: '/Users/me/Public/project/node_modules/css-loader/dist/cjs.js',
options: {
sourceMap: false,
importLoaders: 2
}
},
{
loader: '/Users/me/Public/project/node_modules/postcss-loader/src/index.js',
options: {
sourceMap: false,
plugins: [
function () { /* omitted long function */ }
]
}
},
{
loader: '/Users/me/Public/project/node_modules/sass-loader/dist/cjs.js',
options: {
sourceMap: false,
implementation: {
run_: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
render: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
renderSync: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
info: 'dart-sass\t1.24.0\t(Sass Compiler)\t[Dart]\ndart2js\t2.7.0\t(Dart Compiler)\t[Dart]',
types: {
Boolean: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
Color: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
List: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
Map: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
Null: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
Number: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
String: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
Error: function Error() { [native code] }
}
},
prependData: '@import "@/styles/global.scss";',
sassOptions: {
indentedSyntax: true
}
}
}
]
},
/* config.module.rule('sass').oneOf('normal-modules') */
{
test: /\.module\.\w+$/,
use: [
{
loader: '/Users/me/Public/project/node_modules/vue-style-loader/index.js',
options: {
sourceMap: false,
shadowMode: false
}
},
{
loader: '/Users/me/Public/project/node_modules/css-loader/dist/cjs.js',
options: {
sourceMap: false,
importLoaders: 2,
modules: {
localIdentName: '[name]_[local]_[hash:base64:5]'
}
}
},
{
loader: '/Users/me/Public/project/node_modules/postcss-loader/src/index.js',
options: {
sourceMap: false,
plugins: [
function () { /* omitted long function */ }
]
}
},
{
loader: '/Users/me/Public/project/node_modules/sass-loader/dist/cjs.js',
options: {
sourceMap: false,
implementation: {
run_: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
render: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
renderSync: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
info: 'dart-sass\t1.24.0\t(Sass Compiler)\t[Dart]\ndart2js\t2.7.0\t(Dart Compiler)\t[Dart]',
types: {
Boolean: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
Color: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
List: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
Map: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
Null: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
Number: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
String: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
Error: function Error() { [native code] }
}
},
prependData: '@import "@/styles/global.scss";',
sassOptions: {
indentedSyntax: true
}
}
}
]
},
/* config.module.rule('sass').oneOf('normal') */
{
use: [
{
loader: '/Users/me/Public/project/node_modules/vue-style-loader/index.js',
options: {
sourceMap: false,
shadowMode: false
}
},
{
loader: '/Users/me/Public/project/node_modules/css-loader/dist/cjs.js',
options: {
sourceMap: false,
importLoaders: 2
}
},
{
loader: '/Users/me/Public/project/node_modules/postcss-loader/src/index.js',
options: {
sourceMap: false,
plugins: [
function () { /* omitted long function */ }
]
}
},
{
loader: '/Users/me/Public/project/node_modules/sass-loader/dist/cjs.js',
options: {
sourceMap: false,
implementation: {
run_: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
render: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
renderSync: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
info: 'dart-sass\t1.24.0\t(Sass Compiler)\t[Dart]\ndart2js\t2.7.0\t(Dart Compiler)\t[Dart]',
types: {
Boolean: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
Color: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
List: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
Map: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
Null: function () {
return _call(f, Array.prototype.slice.apply(arguments));
},
Number: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
String: function () {
return _call(f, this, Array.prototype.slice.apply(arguments));
},
Error: function Error() { [native code] }
}
},
prependData: '@import "@/styles/global.scss";',
sassOptions: {
indentedSyntax: true
}
}
}
]
}
]
},
/* config.module.rule('less') */
{
test: /\.less$/,
oneOf: [
/* config.module.rule('less').oneOf('vue-modules') */
{
resourceQuery: /module/,
use: [
{
loader: '/Users/me/Public/project/node_modules/vue-style-loader/index.js',
options: {
sourceMap: false,
shadowMode: false
}
},
{
loader: '/Users/me/Public/project/node_modules/css-loader/dist/cjs.js',
options: {
sourceMap: false,
importLoaders: 2,
modules: {
localIdentName: '[name]_[local]_[hash:base64:5]'
}
}
},
{
loader: '/Users/me/Public/project/node_modules/postcss-loader/src/index.js',
options: {
sourceMap: false,
plugins: [
function () { /* omitted long function */ }
]
}
},
{
loader: 'less-loader',
options: {
sourceMap: false
}
}
]
},
/* config.module.rule('less').oneOf('vue') */
{
resourceQuery: /\?vue/,
use: [
{
loader: '/Users/me/Public/project/node_modules/vue-style-loader/index.js',
options: {
sourceMap: false,
shadowMode: false
}
},
{
loader: '/Users/me/Public/project/node_modules/css-loader/dist/cjs.js',
options: {
sourceMap: false,
importLoaders: 2
}
},
{
loader: '/Users/me/Public/project/node_modules/postcss-loader/src/index.js',
options: {
sourceMap: false,
plugins: [
function () { /* omitted long function */ }
]
}
},
{
loader: 'less-loader',
options: {
sourceMap: false
}
}
]
},
/* config.module.rule('less').oneOf('normal-modules') */
{
test: /\.module\.\w+$/,
use: [
{
loader: '/Users/me/Public/project/node_modules/vue-style-loader/index.js',
options: {
sourceMap: false,
shadowMode: false
}
},
{
loader: '/Users/me/Public/project/node_modules/css-loader/dist/cjs.js',
options: {
sourceMap: false,
importLoaders: 2,
modules: {
localIdentName: '[name]_[local]_[hash:base64:5]'
}
}
},
{
loader: '/Users/me/Public/project/node_modules/postcss-loader/src/index.js',
options: {
sourceMap: false,
plugins: [
function () { /* omitted long function */ }
]
}
},
{
loader: 'less-loader',
options: {
sourceMap: false
}
}
]
},
/* config.module.rule('less').oneOf('normal') */
{
use: [
{
loader: '/Users/me/Public/project/node_modules/vue-style-loader/index.js',
options: {
sourceMap: false,
shadowMode: false
}
},
{
loader: '/Users/me/Public/project/node_modules/css-loader/dist/cjs.js',
options: {
sourceMap: false,
importLoaders: 2
}
},
{
loader: '/Users/me/Public/project/node_modules/postcss-loader/src/index.js',
options: {
sourceMap: false,
plugins: [
function () { /* omitted long function */ }
]
}
},
{
loader: 'less-loader',
options: {
sourceMap: false
}
}
]
}
]
},
/* config.module.rule('stylus') */
{
test: /\.styl(us)?$/,
oneOf: [
/* config.module.rule('stylus').oneOf('vue-modules') */
{
resourceQuery: /module/,
use: [
{
loader: '/Users/me/Public/project/node_modules/vue-style-loader/index.js',
options: {
sourceMap: false,
shadowMode: false
}
},
{
loader: '/Users/me/Public/project/node_modules/css-loader/dist/cjs.js',
options: {
sourceMap: false,
importLoaders: 2,
modules: {
localIdentName: '[name]_[local]_[hash:base64:5]'
}
}
},
{
loader: '/Users/me/Public/project/node_modules/postcss-loader/src/index.js',
options: {
sourceMap: false,
plugins: [
function () { /* omitted long function */ }
]
}
},
{
loader: 'stylus-loader',
options: {
sourceMap: false,
preferPathResolver: 'webpack'
}
}
]
},
/* config.module.rule('stylus').oneOf('vue') */
{
resourceQuery: /\?vue/,
use: [
{
loader: '/Users/me/Public/project/node_modules/vue-style-loader/index.js',
options: {
sourceMap: false,
shadowMode: false
}
},
{
loader: '/Users/me/Public/project/node_modules/css-loader/dist/cjs.js',
options: {
sourceMap: false,
importLoaders: 2
}
},
{
loader: '/Users/me/Public/project/node_modules/postcss-loader/src/index.js',
options: {
sourceMap: false,
plugins: [
function () { /* omitted long function */ }
]
}
},
{
loader: 'stylus-loader',
options: {
sourceMap: false,
preferPathResolver: 'webpack'
}
}
]
},
/* config.module.rule('stylus').oneOf('normal-modules') */
{
test: /\.module\.\w+$/,
use: [
{
loader: '/Users/me/Public/project/node_modules/vue-style-loader/index.js',
options: {
sourceMap: false,
shadowMode: false
}
},
{
loader: '/Users/me/Public/project/node_modules/css-loader/dist/cjs.js',
options: {
sourceMap: false,
importLoaders: 2,
modules: {
localIdentName: '[name]_[local]_[hash:base64:5]'
}
}
},
{
loader: '/Users/me/Public/project/node_modules/postcss-loader/src/index.js',
options: {
sourceMap: false,
plugins: [
function () { /* omitted long function */ }
]
}
},
{
loader: 'stylus-loader',
options: {
sourceMap: false,
preferPathResolver: 'webpack'
}
}
]
},
/* config.module.rule('stylus').oneOf('normal') */
{
use: [
{
loader: '/Users/me/Public/project/node_modules/vue-style-loader/index.js',
options: {
sourceMap: false,
shadowMode: false
}
},
{
loader: '/Users/me/Public/project/node_modules/css-loader/dist/cjs.js',
options: {
sourceMap: false,
importLoaders: 2
}
},
{
loader: '/Users/me/Public/project/node_modules/postcss-loader/src/index.js',
options: {
sourceMap: false,
plugins: [
function () { /* omitted long function */ }
]
}
},
{
loader: 'stylus-loader',
options: {
sourceMap: false,
preferPathResolver: 'webpack'
}
}
]
}
]
},
/* config.module.rule('js') */
{
test: /\.m?jsx?$/,
exclude: [
function () { /* omitted long function */ }
],
use: [
{
loader: '/Users/me/Public/project/node_modules/cache-loader/dist/cjs.js',
options: {
cacheDirectory: '/Users/me/Public/project/node_modules/.cache/babel-loader',
cacheIdentifier: '0fff5c38'
}
},
{
loader: '/Users/me/Public/project/node_modules/babel-loader/lib/index.js'
}
]
},
/* config.module.rule('eslint') */
{
enforce: 'pre',
test: /\.(vue|(j|t)sx?)$/,
exclude: [
/node_modules/,
'/Users/me/Public/project/node_modules/@vue/cli-service/lib'
],
use: [
{
loader: '/Users/me/Public/project/node_modules/eslint-loader/index.js',
options: {
extensions: [
'.js',
'.jsx',
'.vue',
'.ts',
'.tsx'
],
cache: true,
cacheIdentifier: '5749dfb1',
emitWarning: false,
emitError: false,
eslintPath: '/Users/me/Public/project/node_modules/eslint',
formatter: function () { /* omitted long function */ }
}
}
]
},
/* config.module.rule('ts') */
{
test: /\.ts$/,
use: [
{
loader: '/Users/me/Public/project/node_modules/cache-loader/dist/cjs.js',
options: {
cacheDirectory: '/Users/me/Public/project/node_modules/.cache/ts-loader',
cacheIdentifier: 'b1785fd2'
}
},
{
loader: '/Users/me/Public/project/node_modules/babel-loader/lib/index.js'
},
{
loader: 'ts-loader',
options: {
transpileOnly: true,
appendTsSuffixTo: [
'\\.vue$'
],
happyPackMode: false,
getCustomTransformers: program => ({
before: [keysTransformer(program)]
})
}
}
]
},
/* config.module.rule('tsx') */
{
test: /\.tsx$/,
use: [
{
loader: '/Users/me/Public/project/node_modules/cache-loader/dist/cjs.js',
options: {
cacheDirectory: '/Users/me/Public/project/node_modules/.cache/ts-loader',
cacheIdentifier: 'b1785fd2'
}
},
{
loader: '/Users/me/Public/project/node_modules/babel-loader/lib/index.js'
},
{
loader: 'ts-loader',
options: {
transpileOnly: true,
happyPackMode: false,
appendTsxSuffixTo: [
'\\.vue$'
],
getCustomTransformers: program => ({
before: [keysTransformer(program)]
})
}
}
]
},
/* config.module.rule('i18n') */
{
resourceQuery: /blockType=i18n/,
type: 'javascript/auto',
use: [
{
loader: '@kazupon/vue-i18n-loader'
}
]
}
]
},
optimization: {
splitChunks: {
cacheGroups: {
vendors: {
name: 'chunk-vendors',
test: /[\\/]node_modules[\\/]/,
priority: -10,
chunks: 'initial'
},
common: {
name: 'chunk-common',
minChunks: 2,
priority: -20,
chunks: 'initial',
reuseExistingChunk: true
}
}
},
minimizer: [
{
options: {
test: /\.m?js(\?.*)?$/i,
chunkFilter: () => true,
warningsFilter: () => true,
extractComments: false,
sourceMap: true,
cache: true,
cacheKeys: defaultCacheKeys => defaultCacheKeys,
parallel: true,
include: undefined,
exclude: undefined,
minify: undefined,
terserOptions: {
compress: {
arrows: false,
collapse_vars: false,
comparisons: false,
computed_props: false,
hoist_funs: false,
hoist_props: false,
hoist_vars: false,
inline: false,
loops: false,
negate_iife: false,
properties: false,
reduce_funcs: false,
reduce_vars: false,
switches: false,
toplevel: false,
typeofs: false,
booleans: true,
if_return: true,
sequences: true,
unused: true,
conditionals: true,
dead_code: true,
evaluate: true
},
mangle: {
safari10: true
}
}
}
}
]
},
plugins: [
/* config.plugin('vue-loader') */
new VueLoaderPlugin(),
/* config.plugin('define') */
new DefinePlugin(
{
'process.env': {
NODE_ENV: '"development"',
VUE_APP_I18N_LOCALE: '"en"',
VUE_APP_I18N_FALLBACK_LOCALE: '"en"',
BASE_URL: '"/"'
}
}
),
/* config.plugin('case-sensitive-paths') */
new CaseSensitivePathsPlugin(),
/* config.plugin('friendly-errors') */
new FriendlyErrorsWebpackPlugin(
{
additionalTransformers: [
function () { /* omitted long function */ }
],
additionalFormatters: [
function () { /* omitted long function */ }
]
}
),
/* config.plugin('html') */
new HtmlWebpackPlugin(
{
templateParameters: function () { /* omitted long function */ },
template: '/Users/me/Public/project/public/index.html'
}
),
/* config.plugin('pwa') */
new HtmlPwaPlugin(
{
name: 'project'
}
),
/* config.plugin('preload') */
new PreloadPlugin(
{
rel: 'preload',
include: 'initial',
fileBlacklist: [
/\.map$/,
/hot-update\.js$/
]
}
),
/* config.plugin('prefetch') */
new PreloadPlugin(
{
rel: 'prefetch',
include: 'asyncChunks'
}
),
/* config.plugin('copy') */
new CopyPlugin(
[
{
from: '/Users/me/Public/project/public',
to: '/Users/me/Public/project/dist',
toType: 'dir',
ignore: [
'.DS_Store',
{
glob: 'index.html',
matchBase: false
}
]
}
]
),
/* config.plugin('fork-ts-checker') */
new ForkTsCheckerWebpackPlugin(
{
vue: true,
tslint: false,
formatter: 'codeframe',
checkSyntacticErrors: false
}
),
{
definitions: {
'process.env': {
PACKAGE_VERSION: '"2.0.0"',
PACKAGE_NAME: '"project"'
}
}
}
],
entry: {
app: [
'./src/main.ts'
]
}
}
in my code I appended the demo from the readme to an interface I want to use (this is in a .ts file, not a .vue file, so I really half-expected this to work):