Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
fix(webpack): enable extractCSS by default (#4388)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Jun 13, 2022
1 parent 99aff28 commit 4fdea30
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 38 deletions.
4 changes: 2 additions & 2 deletions packages/schema/src/config/webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ export default {
* }
* }
* ```
* @type {false | typeof import('mini-css-extract-plugin').PluginOptions}
* @type {boolean | typeof import('mini-css-extract-plugin').PluginOptions}
*/
extractCSS: false,
extractCSS: true,

/**
* Enables CSS source map support (defaults to true in development)
Expand Down
1 change: 0 additions & 1 deletion packages/webpack/build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export default defineBuildConfig({
'file-loader',
'style-resources-loader',
'url-loader',
'vue-style-loader',
'vue'
],
externals: [
Expand Down
1 change: 0 additions & 1 deletion packages/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"unplugin": "^0.7.0",
"url-loader": "^4.1.1",
"vue-loader": "^17.0.0",
"vue-style-loader": "^4.1.3",
"webpack": "^5.73.0",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-dev-middleware": "^5.3.3",
Expand Down
11 changes: 6 additions & 5 deletions packages/webpack/src/presets/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function extractCSS (ctx: WebpackConfigContext) {
config.plugins.push(new MiniCssExtractPlugin({
filename: fileName(ctx, 'css'),
chunkFilename: fileName(ctx, 'css'),
...options.webpack.extractCSS
...options.webpack.extractCSS === true ? {} : options.webpack.extractCSS
}))
}
}
Expand Down Expand Up @@ -113,10 +113,11 @@ function createCssLoadersRule (ctx: WebpackConfigContext, cssLoaderOptions) {
}

return [
{
loader: 'vue-style-loader',
options: options.webpack.loaders.vueStyle
},
// https://github.com/vuejs/vue-style-loader/issues/56
// {
// loader: 'vue-style-loader',
// options: options.webpack.loaders.vueStyle
// },
cssLoader
]
}
Expand Down
29 changes: 0 additions & 29 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1830,7 +1830,6 @@ __metadata:
url-loader: ^4.1.1
vue: 3.2.37
vue-loader: ^17.0.0
vue-style-loader: ^4.1.3
webpack: ^5.73.0
webpack-bundle-analyzer: ^4.5.0
webpack-dev-middleware: ^5.3.3
Expand Down Expand Up @@ -7386,13 +7385,6 @@ __metadata:
languageName: node
linkType: hard

"hash-sum@npm:^1.0.2":
version: 1.0.2
resolution: "hash-sum@npm:1.0.2"
checksum: 268553ba6c84333f502481d101a7d65cd39f61963544f12fc3ce60264718f471796dbc37348cee08c5529f04fafeba041886a4d35721e34d6440a48a42629283
languageName: node
linkType: hard

"hash-sum@npm:^2.0.0":
version: 2.0.0
resolution: "hash-sum@npm:2.0.0"
Expand Down Expand Up @@ -8489,17 +8481,6 @@ __metadata:
languageName: node
linkType: hard

"loader-utils@npm:^1.0.2":
version: 1.4.0
resolution: "loader-utils@npm:1.4.0"
dependencies:
big.js: ^5.2.2
emojis-list: ^3.0.0
json5: ^1.0.1
checksum: d150b15e7a42ac47d935c8b484b79e44ff6ab4c75df7cc4cb9093350cf014ec0b17bdb60c5d6f91a37b8b218bd63b973e263c65944f58ca2573e402b9a27e717
languageName: node
linkType: hard

"loader-utils@npm:^2.0.0":
version: 2.0.2
resolution: "loader-utils@npm:2.0.2"
Expand Down Expand Up @@ -13541,16 +13522,6 @@ __metadata:
languageName: node
linkType: hard

"vue-style-loader@npm:^4.1.3":
version: 4.1.3
resolution: "vue-style-loader@npm:4.1.3"
dependencies:
hash-sum: ^1.0.2
loader-utils: ^1.0.2
checksum: ef79d0c6329303d69c87f128f67e486bd37e9a8d416aa662edafae62fab727117b7452f50be8b11fe0c4cb43992344d5ef6a46b206f375fca4d37ae5a5b99185
languageName: node
linkType: hard

"vue-tsc@npm:^0.37.5":
version: 0.37.5
resolution: "vue-tsc@npm:0.37.5"
Expand Down

0 comments on commit 4fdea30

Please sign in to comment.