Exclude react from webpack bundle

I had the same problem as you did. Was stuck for one night, found the answer, react-dom requires react/lib/ReactDOM, which still includes react in the bundle. Solution looks like this: externals: { ‘react’: ‘react’, // Case matters here ‘react-dom’ : ‘reactDOM’ // Case matters here } Then add react-dom to the script tag in your … Read more

How to write Webpack plugin which adds modules to the bundle on the fly based on other modules?

This is a really complex question, but I can show how you can add additional dependencies to specific modules as if those were required from that module. This ensures that your added modules will be in the correct chunks and will also be removed if the parent module is removed from the bundle. const CommonJsRequireDependency … Read more

Getting css output using webpack ExtractTextPlugin

ExtractTextPlugin needs to be added in two spots: in the Loader, and as a Plugin. Here’s the example pulled from the stylesheets documentation. // webpack.config.js var ExtractTextPlugin = require(“extract-text-webpack-plugin”); module.exports = { // The standard entry point and output config entry: { posts: “./posts”, post: “./post”, about: “./about” }, output: { filename: “[name].js”, chunkFilename: “[id].js” … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)