New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tree shake Babel Polyfill #729

Merged
merged 1 commit into from Oct 31, 2017
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+514 −456
Diff settings

Always

Just for now

Copy path View file
@@ -4,15 +4,13 @@
"env",
{
"targets": {
"node": "current",
"browsers": [
"last 2 versions",
"IE >= 10"
],
"modules": false,
"useBuiltIns": "usage"
"last 2 versions"
]
},
"forceAllTransforms": true
"modules": false,
"forceAllTransforms": true,
"useBuiltIns": "usage"
}
],
"react"
Copy path View file
@@ -2,7 +2,6 @@
"name": "gravity-pdf",
"private": true,
"dependencies": {
"babel-polyfill": "^6.26.0",
"immutable": "^3.8.1",
"lodash.debounce": "^4.0.8",
"promise-queue": "^2.2.3",
@@ -20,12 +19,13 @@
"superagent": "^3.5.2"
},
"devDependencies": {
"babel-core": "^6.24.1",
"babel-polyfill": "^7.0.0-beta.3",
"babel-core": "^7.0.0-beta.3",
"babel-loader": "^7.0.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.0",
"babel-preset-react": "^6.24.1",
"babel-preset-env": "^7.0.0-beta.3",
"babel-preset-react": "^7.0.0-beta.3",
"chai": "^4.0.0",
"cross-env": "^5.0.0",
"enzyme": "^3.1.0",
Copy path View file
@@ -420,8 +420,7 @@ private function register_scripts() {
wp_register_script( 'gfpdf_js_backbone', PDF_PLUGIN_URL . 'dist/assets/js/gfpdf-backbone.min.js', $pdf_backbone_dependancies, $version ); /* @TODO - remove backbone and use React */
wp_register_script( 'gfpdf_js_backbone_model_binder', PDF_PLUGIN_URL . 'bower_components/backbone.modelbinder/Backbone.ModelBinder.min.js', [ 'backbone', 'underscore' ], $version );
wp_register_script( 'gfpdf_js_vendors', PDF_PLUGIN_URL . 'dist/assets/js/vendor.bundle.min.js', [ 'jquery' ], $version );
wp_register_script( 'gfpdf_js_entrypoint', PDF_PLUGIN_URL . 'dist/assets/js/app.bundle.min.js', [ 'jquery', 'gfpdf_js_vendors' ], $version );
wp_register_script( 'gfpdf_js_entrypoint', PDF_PLUGIN_URL . 'dist/assets/js/app.bundle.min.js', [ 'jquery' ], $version );
wp_register_script( 'gfpdf_js_entries', PDF_PLUGIN_URL . 'dist/assets/js/gfpdf-entries.min.js', [ 'jquery' ], $version );
wp_register_script( 'gfpdf_js_v3_migration', PDF_PLUGIN_URL . 'dist/assets/js/gfpdf-migration.min.js', [ 'gfpdf_js_settings' ], $version );
Copy path View file
@@ -3,12 +3,10 @@ var path = require('path')
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')

var PROD = (process.env.NODE_ENV === 'production')
var vendors = require("./package.json").dependencies

module.exports = {
entry: {
app: './src/assets/js/react/gfpdf-main.js',
vendor: Object.keys(vendors), /* auto-load all dependancies from package.json and include in our vendor bundle */
},
output: {
path: __dirname + '/dist/assets/js/',
@@ -43,7 +41,6 @@ module.exports = {
}
}),
new webpack.optimize.ModuleConcatenationPlugin(),
new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.bundle.min.js' }),
new UglifyJSPlugin({
parallel: true,
sourceMap: false,
@@ -53,7 +50,5 @@ module.exports = {
}
}
})
] : [
new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.bundle.min.js' })
]
] : []
}
Oops, something went wrong.
ProTip! Use n and p to navigate between commits in a pull request.