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:
Dane Everitt 2019-02-09 19:43:11 -08:00
parent 626a63ddd9
commit 761704408e
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
4 changed files with 149 additions and 17 deletions

View file

@ -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/,