We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
git checkout doc/webpack && npm i && npx webpack 🤔
git checkout doc/webpack && npm i && npx webpack
https://webpack.js.org/guides/tree-shaking/
src/index.js
import { requiresFormData } from "@esri/arcgis-rest-request"; let element = document.createElement('div'); document.body.appendChild(element); const options = { params: { baz: "bar" } } element.innerHTML = requiresFormData(options); // false
package.json
{ "name": "@esri/arcgis-rest-webpack-demo", "version": "1.0.0", "private": true, "description": "", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "build": "webpack" }, "keywords": [], "author": "", "license": "ISC", "devDependencies": { "webpack": "^4.28.2", "webpack-cli": "^3.1.2" }, "dependencies": { "@esri/arcgis-rest-request": "^1.14.3" }, "sideEffects": false }
webpack.config.js
const path = require('path'); module.exports = { entry: './src/index.js', output: { filename: 'bundle.js', path: path.resolve(__dirname, 'dist') }, mode: 'development', optimization: { usedExports: true } };
The text was updated successfully, but these errors were encountered:
docs(tree): add tree shaking demo
a3d8d63
AFFECTS PACKAGES: @esri/arcgis-rest-webpack-demo ISSUES CLOSED: #424
77a84d9
7fe9154
a demo that shows webpack tree shaking in action can now be found in the repo
https://github.com/Esri/arcgis-rest-js/tree/master/demos/tree-shaking
disclaimer: there are still some gotcha's here related to the fact that our compilation target is es5 and we include tslib as a dependency.
es5
tslib
that said, we'd love to hear from users to try and make additional improvements.
Sorry, something went wrong.
No branches or pull requests
git checkout doc/webpack && npm i && npx webpack
🤔https://webpack.js.org/guides/tree-shaking/
src/index.js
package.json
webpack.config.js
The text was updated successfully, but these errors were encountered: