@wang1212/create-web-app
Advanced tools
Comparing version 0.3.17 to 0.3.18
{ | ||
"name": "@wang1212/create-web-app", | ||
"version": "0.3.17", | ||
"version": "0.3.18", | ||
"keywords": [ | ||
@@ -5,0 +5,0 @@ "web-app", |
// See https://babeljs.io/docs/en/configuration | ||
module.exports = (api) => { | ||
// This caches the Babel config by environment. | ||
// https://github.com/pmmmwh/react-refresh-webpack-plugin#usage | ||
api.cache.using(() => process.env.NODE_ENV) | ||
return { | ||
presets: [ | ||
'@babel/preset-env', | ||
[ | ||
'@babel/preset-typescript', | ||
{ | ||
isTSX: true, | ||
allExtensions: true, | ||
}, | ||
], | ||
module.exports = { | ||
presets: [ | ||
'@babel/preset-env', | ||
[ | ||
'@babel/preset-typescript', | ||
{ | ||
isTSX: true, | ||
allExtensions: true, | ||
}, | ||
], | ||
plugins: [ | ||
'@babel/plugin-syntax-dynamic-import', | ||
'@babel/plugin-proposal-class-properties', | ||
'@babel/plugin-proposal-object-rest-spread', | ||
// Applies the react-refresh Babel plugin on non-production modes only | ||
!api.env('production') && 'react-refresh/babel', | ||
].filter(Boolean), | ||
} | ||
], | ||
plugins: ['@babel/plugin-syntax-dynamic-import', '@babel/plugin-proposal-class-properties', '@babel/plugin-proposal-object-rest-spread'], | ||
} |
@@ -9,5 +9,5 @@ /* eslint-disable */ | ||
/* app src directory */ | ||
src: './src/', | ||
src: require('path').resolve(__dirname, '../src/'), | ||
/* app build directory */ | ||
build: require('path').resolve(__dirname, '../build/'), | ||
}) |
@@ -15,2 +15,3 @@ /* eslint-disable */ | ||
// webpack plugins | ||
const WorkerPlugin = require('worker-plugin') | ||
const CopyWebpackPlugin = require('copy-webpack-plugin') | ||
@@ -25,3 +26,2 @@ const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin') | ||
const postcssNormalize = require('postcss-normalize') | ||
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin') | ||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin | ||
@@ -35,3 +35,3 @@ | ||
devtool: isEnvDevelopment ? 'cheap-module-eval-source-map' : 'none', | ||
watch: !!isEnvDevelopment, | ||
watch: isEnvDevelopment, | ||
watchOptions: { | ||
@@ -42,3 +42,3 @@ ignored: /node_modules/, | ||
entry: { | ||
app: SRC_DIR + 'index.js', | ||
app: path.join(SRC_DIR, '/index.js'), | ||
}, | ||
@@ -115,11 +115,2 @@ output: { | ||
{ | ||
test: /\.worker\.js$/i, | ||
exclude: /node_modules/, | ||
use: [ | ||
{ | ||
loader: 'worker-loader', | ||
}, | ||
], | ||
}, | ||
{ | ||
test: /\.([tj]s|mjs)$/i, | ||
@@ -246,2 +237,3 @@ exclude: /node_modules/, | ||
}), | ||
new WorkerPlugin(), | ||
new CopyWebpackPlugin({ | ||
@@ -279,3 +271,2 @@ patterns: [ | ||
}), | ||
isEnvDevelopment && new ReactRefreshWebpackPlugin(), | ||
// This is necessary to emit hot updates (currently CSS only): | ||
@@ -282,0 +273,0 @@ isEnvDevelopment && new webpack.HotModuleReplacementPlugin(), |
@@ -37,5 +37,4 @@ { | ||
"@babel/preset-typescript": "^7.10.4", | ||
"@pmmmwh/react-refresh-webpack-plugin": "^0.3.3", | ||
"@typescript-eslint/eslint-plugin": "^3.7.0", | ||
"@typescript-eslint/parser": "^3.7.0", | ||
"@typescript-eslint/eslint-plugin": "^3.7.1", | ||
"@typescript-eslint/parser": "^3.7.1", | ||
"babel-jest": "^26.1.0", | ||
@@ -69,7 +68,6 @@ "babel-loader": "^8.1.0", | ||
"prettier": "2.0.5", | ||
"react-refresh": "^0.8.3", | ||
"sass": "^1.26.10", | ||
"sass-loader": "^9.0.2", | ||
"style-loader": "^1.2.1", | ||
"terser-webpack-plugin": "^3.0.7", | ||
"terser-webpack-plugin": "^3.0.8", | ||
"typescript": "^3.9.7", | ||
@@ -81,4 +79,4 @@ "url-loader": "^4.1.0", | ||
"workbox-webpack-plugin": "^5.1.3", | ||
"worker-loader": "^2.0.0" | ||
"worker-plugin": "^4.0.3" | ||
} | ||
} |
@@ -9,5 +9,5 @@ /* eslint-disable */ | ||
/* app src directory */ | ||
src: './src/', | ||
src: require('path').resolve(__dirname, '../src/'), | ||
/* app build directory */ | ||
build: require('path').resolve(__dirname, '../build/'), | ||
}) |
@@ -15,2 +15,3 @@ /* eslint-disable */ | ||
// webpack plugins | ||
const WorkerPlugin = require('worker-plugin') | ||
const CopyWebpackPlugin = require('copy-webpack-plugin') | ||
@@ -34,3 +35,3 @@ const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin') | ||
devtool: isEnvDevelopment ? 'cheap-module-eval-source-map' : 'none', | ||
watch: !!isEnvDevelopment, | ||
watch: isEnvDevelopment, | ||
watchOptions: { | ||
@@ -41,3 +42,3 @@ ignored: /node_modules/, | ||
entry: { | ||
app: SRC_DIR + 'index.js', | ||
app: path.join(SRC_DIR, '/index.js'), | ||
}, | ||
@@ -115,11 +116,2 @@ output: { | ||
{ | ||
test: /\.worker\.js$/i, | ||
exclude: /node_modules/, | ||
use: [ | ||
{ | ||
loader: 'worker-loader', | ||
}, | ||
], | ||
}, | ||
{ | ||
test: /\.([tj]sx?|mjs)$/i, | ||
@@ -246,2 +238,3 @@ exclude: /node_modules/, | ||
}), | ||
new WorkerPlugin(), | ||
new CopyWebpackPlugin({ | ||
@@ -248,0 +241,0 @@ patterns: [ |
@@ -46,3 +46,3 @@ { | ||
"@babel/preset-typescript": "^7.10.4", | ||
"@pmmmwh/react-refresh-webpack-plugin": "^0.3.3", | ||
"@pmmmwh/react-refresh-webpack-plugin": "^0.4.1", | ||
"@types/loadable__component": "^5.13.0", | ||
@@ -52,4 +52,4 @@ "@types/react": "^16.9.43", | ||
"@types/react-router-dom": "^5.1.5", | ||
"@typescript-eslint/eslint-plugin": "^3.7.0", | ||
"@typescript-eslint/parser": "^3.7.0", | ||
"@typescript-eslint/eslint-plugin": "^3.7.1", | ||
"@typescript-eslint/parser": "^3.7.1", | ||
"babel-jest": "^26.1.0", | ||
@@ -90,3 +90,3 @@ "babel-loader": "^8.1.0", | ||
"style-loader": "^1.2.1", | ||
"terser-webpack-plugin": "^3.0.7", | ||
"terser-webpack-plugin": "^3.0.8", | ||
"typescript": "^3.9.7", | ||
@@ -98,4 +98,4 @@ "url-loader": "^4.1.0", | ||
"workbox-webpack-plugin": "^5.1.3", | ||
"worker-loader": "^2.0.0" | ||
"worker-plugin": "^4.0.3" | ||
} | ||
} |
211821
2796