Fix HMR and backtrack for SFC support now that PHPStorm supports them
Of course I wasted forever migrating OUT of SFCs only to go back to them.
This commit is contained in:
parent
626a63ddd9
commit
761704408e
4 changed files with 149 additions and 17 deletions
|
@ -9,6 +9,8 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|||
const ShellPlugin = require('webpack-shell-plugin');
|
||||
const PurgeCssPlugin = require('purgecss-webpack-plugin');
|
||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
|
||||
const VueLoaderPlugin = require('vue-loader/lib/plugin');
|
||||
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
||||
|
||||
const isProduction = process.env.NODE_ENV === 'production';
|
||||
|
||||
|
@ -27,6 +29,10 @@ let plugins = [
|
|||
integrity: true,
|
||||
integrityHashes: ['sha384'],
|
||||
}),
|
||||
new VueLoaderPlugin(),
|
||||
new ForkTsCheckerWebpackPlugin({
|
||||
vue: true,
|
||||
}),
|
||||
];
|
||||
|
||||
if (isProduction) {
|
||||
|
@ -72,6 +78,7 @@ const typescriptLoaders = [
|
|||
options: {
|
||||
appendTsSuffixTo: [/\.vue$/],
|
||||
experimentalWatchApi: true,
|
||||
transpileOnly: true,
|
||||
}
|
||||
}
|
||||
];
|
||||
|
@ -133,6 +140,10 @@ module.exports = {
|
|||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.vue$/,
|
||||
use: 'vue-loader',
|
||||
},
|
||||
{
|
||||
test: /\.ts$/,
|
||||
exclude: /node_modules/,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue