Skip to content

Commit b303544

Browse files
authored
Merge pull request #5690 from PawFV/hotfix/v1.12.3
fix: development hot-reload speed webpack config
2 parents bd24d6c + fee81b1 commit b303544

File tree

5 files changed

+219
-13
lines changed

5 files changed

+219
-13
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4949
- Using dayjs for dates in taxCalc.ts to make it work properly in Safari (#5364)
5050
- Awaiting addItem action call inside mergeServerItem action (#5165)
5151
- Moved `phoneNum` to proper branch - @lukaszjedrasik ([#5730](https://github.com/vuestorefront/vue-storefront/issues/5730))
52-
52+
- Development hot-reload speed webpack config - ([#5559](https://github.com/vuestorefront/vue-storefront/issues/5559))
5353
## [1.12.2] - 2020.07.28
5454

5555
### Added

core/build/module-build.config.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@ module.exports = {
1111
},
1212
module: {
1313
rules: [
14-
{ test: /\.ts$/, use: ['ts-loader'], exclude: /node_modules/ }
14+
{
15+
test: /\.ts$/,
16+
use: ['ts-loader'],
17+
options: {
18+
transpileOnly: true
19+
},
20+
exclude: /node_modules/
21+
}
1522
]
1623
},
1724
externals: ['@vue-storefront/core']

core/build/webpack.base.config.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import autoprefixer from 'autoprefixer';
77
import HTMLPlugin from 'html-webpack-plugin';
88
import webpack from 'webpack';
99
import dayjs from 'dayjs';
10-
10+
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin'
1111
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
1212

1313
// eslint-disable-next-line import/first
@@ -73,6 +73,13 @@ export default {
7373
new webpack.DefinePlugin({
7474
'process.env.__APPVERSION__': JSON.stringify(require('../../package.json').version),
7575
'process.env.__BUILDTIME__': JSON.stringify(dayjs().format('YYYY-MM-DD HH:mm:ss'))
76+
}),
77+
new ForkTsCheckerWebpackPlugin({
78+
typescript: {
79+
extensions: {
80+
vue: true
81+
}
82+
}
7683
})
7784
],
7885
devtool: 'source-map',
@@ -134,7 +141,8 @@ export default {
134141
test: /\.ts$/,
135142
loader: 'ts-loader',
136143
options: {
137-
appendTsSuffixTo: [/\.vue$/]
144+
appendTsSuffixTo: [/\.vue$/],
145+
transpileOnly: true
138146
},
139147
exclude: /node_modules/
140148
},

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"dayjs": "^1.8.21",
6464
"es6-promise": "^4.2.8",
6565
"express": "^4.14.0",
66+
"fork-ts-checker-webpack-plugin": "^6.2.0",
6667
"fs-extra": "^8.1.0",
6768
"glob": "^7.1.6",
6869
"graphql": "^0.13.2",

0 commit comments

Comments
 (0)