Improve compile speed for ts-loader

This commit is contained in:
AkiraFukushima 2022-05-01 18:02:47 +09:00
parent a0ba665116
commit 5c975d515e
No known key found for this signature in database
GPG Key ID: B6E51BAC4DE1A957
3 changed files with 10 additions and 34 deletions

View File

@ -16,17 +16,6 @@ let mainConfig = {
externals: [...Object.keys(dependencies || {})],
module: {
rules: [
{
test: /\.(js|ts)$/,
enforce: 'pre',
exclude: /node_modules/,
use: {
loader: 'eslint-loader',
options: {
formatter: require('eslint-friendly-formatter')
}
}
},
{
test: /\.ts$/,
exclude: /node_modules/,

View File

@ -17,30 +17,14 @@ let rendererConfig = {
},
module: {
rules: [
{
test: /\.(js|vue|ts)$/,
enforce: 'pre',
exclude: /node_modules/,
use: {
loader: 'eslint-loader',
options: {
formatter: require('eslint-friendly-formatter')
}
}
},
{
test: /\.vue$/,
use: {
loader: 'vue-loader',
options: {
extractCSS: process.env.NODE_ENV === 'production',
loaders: {
js: 'ts-loader',
ts: 'ts-loader',
sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax=1',
scss: 'vue-style-loader!css-loader!sass-loader',
less: 'vue-style-loader!css-loader!less-loader'
}
esModule: true,
optimizeSSR: false
}
}
},
@ -109,19 +93,20 @@ let rendererConfig = {
exclude: /node_modules/,
use: [
{
loader: 'babel-loader'
loader: 'babel-loader?cacheDirectory'
},
{
loader: 'ts-loader',
options: {
appendTsSuffixTo: [/\.vue$/]
appendTsSuffixTo: [/\.vue$/],
transpileOnly: true
}
}
]
},
{
test: /\.js$/,
use: 'babel-loader',
use: 'babel-loader?cacheDirectory',
exclude: /node_modules/
},
{

View File

@ -21,6 +21,8 @@
"main": "./dist/electron/main.js",
"scripts": {
"dev": "node .electron-vue/dev-runner.js",
"dev:main": "webpack --node-env=development --mode development --progress --config .electron-vue/webpack.main.config.js",
"dev:renderer": "webpack --node-env=development --mode development --progress --config .electron-vue/webpack.renderer.config.js",
"lint": "eslint --ext .js,.vue,.ts -f ./node_modules/eslint-friendly-formatter src spec",
"lint:fix": "eslint --ext .js,.vue,.ts -f ./node_modules/eslint-friendly-formatter --fix src spec",
"stylelint": "stylelint '**/*.vue'",
@ -36,7 +38,7 @@
"pack": "yarn run pack:main && yarn run pack:renderer",
"pack:main": "webpack --node-env=production --mode production --progress --config .electron-vue/webpack.main.config.js",
"pack:renderer": "webpack --node-env=production --mode production --progress --config .electron-vue/webpack.renderer.config.js",
"postinstall": "yarn run lint:fix",
"typecheck": "tsc -p . --noEmit",
"spec": "NODE_ENV=test jest -u --maxWorkers=3"
},
"jest": {
@ -73,7 +75,6 @@
"@fortawesome/free-regular-svg-icons": "^6.1.0",
"@fortawesome/free-solid-svg-icons": "^6.1.0",
"@fortawesome/vue-fontawesome": "^3.0.0-5",
"vue-virtual-scroller": "2.0.0-alpha.1",
"@trodi/electron-splashscreen": "^1.0.2",
"about-window": "^1.15.2",
"animate.css": "^4.1.0",
@ -108,6 +109,7 @@
"vue-popperjs": "^2.3.0",
"vue-resize": "^2.0.0-alpha.1",
"vue-router": "^4.0.14",
"vue-virtual-scroller": "2.0.0-alpha.1",
"vue3-i18next": "^0.2.0",
"vuex": "^4.0.2",
"vuex-router-sync": "^6.0.0-rc.1"