-
-
Save sadeghbarati/ddccf619a271120e781f6c59cc17b120 to your computer and use it in GitHub Desktop.
Rollup manual chunks for vendor bundle
This file contains hidden or 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
import babel from 'rollup-plugin-babel'; | |
import resolve from 'rollup-plugin-node-resolve'; | |
import commonjs from 'rollup-plugin-commonjs'; | |
import replace from 'rollup-plugin-replace'; | |
const env = process.env.NODE_ENV || 'development'; | |
export default { | |
input: [ | |
'src/index.js' | |
], | |
output: { | |
dir: 'build/js', | |
format: 'system', | |
name: 'app', | |
sourcemap: true, | |
}, | |
manualChunks: { | |
'vendor': [ | |
'node_modules/react/index.js', | |
'node_modules/react-dom/index.js' | |
] | |
}, | |
experimentalCodeSplitting: true, | |
plugins: [ | |
babel({ | |
exclude: 'node_modules/**' | |
}), | |
resolve(), | |
commonjs(), | |
replace({ | |
'process.env.NODE_ENV': JSON.stringify(env) | |
}) | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment