andriijas / react-app-rewire-vendor-splitting Goto Github PK
View Code? Open in Web Editor NEWLong term caching and split app into vendors.js
License: MIT License
Long term caching and split app into vendors.js
License: MIT License
error after yarn build
config.plugins[etpIndex].options.allChunks = true;
^
TypeError: Cannot read property 'options' of undefined
I created project with CRA, added react-app-rewired and react-app-rewire-vendor-splitting. When I tried to start project, I got this:
config.entry = { ...config.entry, ...(extractVendors() || {}) };
^^^
SyntaxError: Unexpected token ...
at createScript (vm.js:74:10)
at Object.runInThisContext (vm.js:116:10)
at Module._compile (module.js:533:28)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (D:\Work\z661nvj7m4\config-overrides.js:1:93)
error Command failed with exit code 1.
My package.json:
{
"name": "new",
"version": "1.0.0",
"description": "",
"keywords": [],
"homepage": "https://codesandbox.io/s/new",
"main": "src/index.js",
"dependencies": {
"react": "16.2.0",
"react-app-rewire-vendor-splitting": "1.3.0",
"react-app-rewired": "1.4.1",
"react-dom": "16.2.0",
"react-scripts": "1.1.0"
},
"devDependencies": {},
"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test --env=jsdom",
"eject": "react-app-rewired eject"
}
}
My config-overrides.js:
const rewireVendorSplitting = require("react-app-rewire-vendor-splitting");
module.exports = function override(config, env) {
config = rewireVendorSplitting(config, env);
return config;
};
and vendors.js:
module.exports = {
vendors: [
"prop-types",
"react",
"react-dom",
"react-router-dom",
"react-router-redux",
"react-redux",
"redux"
]
};
repo with it: https://github.com/Vahagn1993/z661nvj7m4
Just try to yarn and yarn start. Is it work for you?
Just did a try by following the guides in readme. Run npm run build
, and there is no new split chunks called vendors?
and also the example repo you mention in the readme is not using this library
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.