mirror of
https://github.com/feathericons/feather.git
synced 2023-08-10 21:13:24 +03:00
fix: Remove unused polyfills and update build config
Removes polyfills for `Object.assign` and `Set` which, as far as I can tell, are unused in the codebase. Updates `webpack` from 3 to 4. Replaces `babel-preset-es2015` with `babel-preset-env`. Reduces the minified bundle size (`feather.min.js`) by **9.3kB** (72.4kB to 63.1kB). Does not change any functionality of the library.
This commit is contained in:
parent
bd129d9dcf
commit
c978b1cb4e
13
.babelrc
13
.babelrc
@ -1,4 +1,13 @@
|
|||||||
{
|
{
|
||||||
"presets": ["es2015"],
|
"presets": [
|
||||||
"plugins": ["transform-object-rest-spread"]
|
[
|
||||||
|
"env",
|
||||||
|
{
|
||||||
|
"targets": {
|
||||||
|
"browsers": ["last 2 versions"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"stage-2"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
@ -21,5 +21,5 @@ mkdir dist/icons
|
|||||||
./node_modules/.bin/babel-node bin/build-svgs.js
|
./node_modules/.bin/babel-node bin/build-svgs.js
|
||||||
|
|
||||||
# Build JavaScript library
|
# Build JavaScript library
|
||||||
./node_modules/.bin/webpack --output-filename feather.js
|
./node_modules/.bin/webpack --output-filename feather.js --mode development
|
||||||
./node_modules/.bin/webpack --output-filename feather.min.js -p
|
./node_modules/.bin/webpack --output-filename feather.min.js --mode production
|
||||||
|
4947
package-lock.json
generated
4947
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
@ -27,7 +27,8 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"classnames": "^2.2.5"
|
"classnames": "^2.2.5",
|
||||||
|
"core-js": "^2.5.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/cli": "^5.2.5",
|
"@commitlint/cli": "^5.2.5",
|
||||||
@ -35,12 +36,10 @@
|
|||||||
"algoliasearch": "^3.27.1",
|
"algoliasearch": "^3.27.1",
|
||||||
"babel-cli": "^6.24.1",
|
"babel-cli": "^6.24.1",
|
||||||
"babel-loader": "^7.1.1",
|
"babel-loader": "^7.1.1",
|
||||||
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
"babel-preset-env": "^1.7.0",
|
||||||
"babel-preset-es2015": "^6.24.1",
|
"babel-preset-stage-2": "^6.24.1",
|
||||||
"babel-register": "^6.24.1",
|
|
||||||
"cheerio": "^1.0.0-rc.2",
|
"cheerio": "^1.0.0-rc.2",
|
||||||
"commitizen": "^2.9.6",
|
"commitizen": "^2.9.6",
|
||||||
"core-js": "^2.5.3",
|
|
||||||
"cz-conventional-changelog": "^2.1.0",
|
"cz-conventional-changelog": "^2.1.0",
|
||||||
"eslint": "^4.15.0",
|
"eslint": "^4.15.0",
|
||||||
"eslint-config-airbnb-base": "^12.1.0",
|
"eslint-config-airbnb-base": "^12.1.0",
|
||||||
@ -56,7 +55,8 @@
|
|||||||
"rimraf": "^2.6.2",
|
"rimraf": "^2.6.2",
|
||||||
"semantic-release": "^12.2.2",
|
"semantic-release": "^12.2.2",
|
||||||
"svgo": "^0.7.2",
|
"svgo": "^0.7.2",
|
||||||
"webpack": "^3.10.0"
|
"webpack": "^4.8.3",
|
||||||
|
"webpack-cli": "^2.1.3"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -1,12 +1,7 @@
|
|||||||
import path from 'path';
|
const path = require('path');
|
||||||
|
|
||||||
export default {
|
module.exports = {
|
||||||
entry: [
|
entry: ['core-js/fn/array/from', path.resolve(__dirname, 'src/index.js')],
|
||||||
'core-js/fn/array/from',
|
|
||||||
'core-js/fn/object/assign',
|
|
||||||
'core-js/fn/set',
|
|
||||||
path.resolve(__dirname, 'src/index.js'),
|
|
||||||
],
|
|
||||||
output: {
|
output: {
|
||||||
path: path.resolve(__dirname, 'dist'),
|
path: path.resolve(__dirname, 'dist'),
|
||||||
libraryTarget: 'umd',
|
libraryTarget: 'umd',
|
Loading…
Reference in New Issue
Block a user