Skip to content
This repository has been archived by the owner on Nov 28, 2024. It is now read-only.

Commit

Permalink
build: update css-loader
Browse files Browse the repository at this point in the history
  • Loading branch information
zerosoul committed Jul 30, 2020
1 parent b009d0a commit 5179754
Show file tree
Hide file tree
Showing 3 changed files with 1,786 additions and 2,611 deletions.
18 changes: 9 additions & 9 deletions config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const cssModuleRegex = /\.module\.css$/;

// This is the production and development configuration.
// It is focused on developer experience, fast rebuilds, and a minimal bundle.
module.exports = function(webpackEnv) {
module.exports = function (webpackEnv) {
const isEnvDevelopment = webpackEnv === 'development';
const isEnvProduction = webpackEnv === 'production';

Expand All @@ -50,7 +50,7 @@ module.exports = function(webpackEnv) {
const env = getClientEnvironment(paths.publicUrlOrPath.slice(0, -1));

// common function to get style loaders
const getStyleLoaders = cssOptions => {
const getStyleLoaders = (cssOptions) => {
const loaders = [
isEnvDevelopment && require.resolve('style-loader'),
isEnvProduction && {
Expand Down Expand Up @@ -118,8 +118,9 @@ module.exports = function(webpackEnv) {
publicPath: paths.publicUrlOrPath,
// Point sourcemap entries to original disk location (format as URL on Windows)
devtoolModuleFilenameTemplate: isEnvProduction
? info => path.relative(paths.appSrc, info.absoluteResourcePath).replace(/\\/g, '/')
: isEnvDevelopment && (info => path.resolve(info.absoluteResourcePath).replace(/\\/g, '/')),
? (info) => path.relative(paths.appSrc, info.absoluteResourcePath).replace(/\\/g, '/')
: isEnvDevelopment &&
((info) => path.resolve(info.absoluteResourcePath).replace(/\\/g, '/')),
// Prevents conflicts when multiple webpack runtimes (from different apps)
// are used on the same page.
jsonpFunction: `webpackJsonp${appPackageJson.name}`,
Expand Down Expand Up @@ -183,7 +184,7 @@ module.exports = function(webpackEnv) {
// https://twitter.com/wSokra/status/969679223278505985
// https://github.com/facebook/create-react-app/issues/5358
runtimeChunk: {
name: entrypoint => `runtime-${entrypoint.name}`
name: (entrypoint) => `runtime-${entrypoint.name}`
}
},
resolve: {
Expand All @@ -199,8 +200,8 @@ module.exports = function(webpackEnv) {
// `web` extension prefixes have been added for better support
// for React Native Web.
extensions: paths.moduleFileExtensions
.map(ext => `.${ext}`)
.filter(ext => useTypeScript || !ext.includes('ts')),
.map((ext) => `.${ext}`)
.filter((ext) => useTypeScript || !ext.includes('ts')),
alias: {
// Support React Native Web
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
Expand Down Expand Up @@ -282,7 +283,6 @@ module.exports = function(webpackEnv) {
inputSourceMap: shouldUseSourceMap
}
},
// "postcss" loader applies autoprefixer to our CSS.
// "css" loader resolves paths in CSS and adds assets as dependencies.
// "style" loader turns CSS into JS modules that inject <style> tags.
// In production, we use MiniCSSExtractPlugin to extract that CSS
Expand Down Expand Up @@ -400,7 +400,7 @@ module.exports = function(webpackEnv) {
manifest[file.name] = file.path;
return manifest;
}, seed);
const entrypointFiles = entrypoints.main.filter(fileName => !fileName.endsWith('.map'));
const entrypointFiles = entrypoints.main.filter((fileName) => !fileName.endsWith('.map'));

return {
files: manifestFiles,
Expand Down
38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"main": "index.js",
"dependencies": {
"core-js": "^3.6.5",
"css-loader": "3.5.3",
"css-loader": "4.1.0",
"dotenv": "8.2.0",
"dotenv-expand": "5.1.0",
"file-loader": "6.0.0",
"fs-extra": "^9.0.0",
"fs-extra": "^9.0.1",
"html-webpack-plugin": "4.3.0",
"mini-css-extract-plugin": "0.9.0",
"pnp-webpack-plugin": "1.6.4",
Expand All @@ -21,35 +21,35 @@
"resolve-url-loader": "3.1.1",
"style-loader": "1.2.1",
"styled-components": "^5.1.1",
"styled-reset": "^4.1.5",
"terser-webpack-plugin": "3.0.2",
"styled-reset": "^4.2.1",
"terser-webpack-plugin": "3.0.8",
"url-loader": "4.1.0",
"webpack": "4.43.0",
"webpack": "4.44.0",
"webpack-dev-server": "3.11.0",
"webpack-manifest-plugin": "2.2.0",
"workbox-webpack-plugin": "5.1.3"
},
"devDependencies": {
"@babel/core": "^7.10.2",
"@babel/plugin-proposal-class-properties": "^7.10.1",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.1",
"@babel/core": "^7.10.5",
"@babel/plugin-proposal-class-properties": "^7.10.4",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.4",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/polyfill": "^7.10.1",
"@babel/preset-env": "^7.10.2",
"@babel/preset-react": "^7.10.1",
"@commitlint/cli": "^8.3.5",
"@commitlint/config-conventional": "^8.3.4",
"auto-changelog": "^2.0.0",
"@babel/polyfill": "^7.10.4",
"@babel/preset-env": "^7.10.4",
"@babel/preset-react": "^7.10.4",
"@commitlint/cli": "^9.1.1",
"@commitlint/config-conventional": "^9.1.1",
"auto-changelog": "^2.2.0",
"babel-eslint": "10.1.0",
"babel-loader": "^8.1.0",
"babel-plugin-import": "^1.13.0",
"eslint": "^7.1.0",
"eslint": "^7.5.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-react": "^7.20.0",
"eslint-plugin-react-hooks": "^4.0.4",
"gh-pages": "^3.0.0",
"eslint-plugin-react": "^7.20.5",
"eslint-plugin-react-hooks": "^4.0.8",
"gh-pages": "^3.1.0",
"husky": "^4.2.5",
"lint-staged": "^10.2.7",
"lint-staged": "^10.2.11",
"prettier": "^2.0.5"
},
"repository": {
Expand Down
Loading

0 comments on commit 5179754

Please sign in to comment.