Skip to content

Commit bc7daca

Browse files
committed
Add "browser" config to package.json and remove bundled react
1 parent c764303 commit bc7daca

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.0.1",
44
"description": "A component that is resizable with handles.",
55
"main": "index.js",
6+
"browser": "dist/bundle.js",
67
"scripts": {
78
"lint": "eslint --ext .js,.jsx lib/ test/; flow",
89
"test": "echo \"Error: no test specified\" && exit 1",

webpack.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,21 @@ module.exports = {
88
filename: "bundle.js",
99
sourceMapFilename: "[file].map",
1010
},
11+
externals: {
12+
'react': {
13+
'commonjs': 'react',
14+
'commonjs2': 'react',
15+
'amd': 'react',
16+
// React dep should be available as window.React, not window.react
17+
'root': 'React'
18+
},
19+
'react-dom': {
20+
'commonjs': 'react-dom',
21+
'commonjs2': 'react-dom',
22+
'amd': 'react-dom',
23+
'root': 'ReactDOM'
24+
}
25+
},
1126
module: {
1227
loaders: [
1328
{test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel-loader?cacheDirectory=true'},

0 commit comments

Comments
 (0)