-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set incremental mode as true, set target as es6 in tsconfig.json
- Loading branch information
Showing
8 changed files
with
19 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
/** | ||
* Created by: Andrey Polyakov ([email protected]) | ||
*/ | ||
const {argv} = require('yargs'); | ||
|
||
module.exports = (api) => { | ||
const env = argv.env || []; | ||
const mode = !!env.find((value) => value === 'mode=dev') | ||
? 'development' | ||
: 'production'; | ||
const mode = process.env.NODE_ENV ?? 'production'; | ||
|
||
// This caches the Babel config by environment. | ||
api.cache.using(() => mode); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,9 +17,9 @@ | |
"author": "Andrey Polyakov <[email protected]>", | ||
"main": "webpack.config.babel.js", | ||
"scripts": { | ||
"build": "webpack --config webpack.config.babel.js", | ||
"profile": "webpack --profile --json --config webpack.config.babel.js > ./dist/profile.json && webpack-bundle-analyzer ./dist/profile.json", | ||
"start": "webpack serve --env mode=dev --env isDevServer --env NODE_ENV=local --config webpack.config.babel.js", | ||
"build": "cross-env NODE_ENV=production webpack --config webpack.config.babel.js", | ||
"profile": "cross-env NODE_ENV=production webpack --profile --json --config webpack.config.babel.js > ./dist/profile.json && webpack-bundle-analyzer ./dist/profile.json", | ||
"start": "cross-env WEBPACK_IS_DEV_SERVER=true NODE_ENV=development webpack serve --config webpack.config.babel.js", | ||
"release": "npm version patch" | ||
}, | ||
"husky": { | ||
|
@@ -60,6 +60,7 @@ | |
"clean-webpack-plugin": "~3.0.0", | ||
"copy-webpack-plugin": "~6.3.0", | ||
"core-js": "~3.7.0", | ||
"cross-env": "^7.0.3", | ||
"css-loader": "~5.0.0", | ||
"cssnano": "~4.1.10", | ||
"eslint": "~7.13.0", | ||
|
@@ -104,8 +105,7 @@ | |
"webpack-bundle-analyzer": "~4.1.0", | ||
"webpack-cli": "~4.5.0", | ||
"webpack-dev-server": "~3.11.2", | ||
"webpack-merge": "~5.3.0", | ||
"yargs": "~16.1.0" | ||
"webpack-merge": "~5.3.0" | ||
}, | ||
"importSort": { | ||
".ts, .tsx": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,6 @@ | ||
/** | ||
* Created by: Andrey Polyakov ([email protected]) | ||
*/ | ||
import {argv} from 'yargs'; | ||
|
||
export const parseArguments = () => { | ||
const {env = []} = argv; | ||
return env.reduce((accumulator, currentValue) => { | ||
const [key, value = true] = currentValue.split('='); | ||
return {...accumulator, [key]: value}; | ||
}, {}); | ||
}; | ||
|
||
export const arrayFilterEmpty = (array) => array.filter((x) => !!x); | ||
|
||
export const pathRewrite = (localUrl, remoteUrl) => (path) => | ||
|