mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-28 20:43:56 +03:00
Added UMD build
This commit is contained in:
parent
bd75e81719
commit
cc7037addb
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,3 +3,4 @@ node_modules
|
|||
.DS_Store
|
||||
lib
|
||||
coverage
|
||||
dist
|
|
@ -5,7 +5,12 @@
|
|||
"main": "lib/index.js",
|
||||
"scripts": {
|
||||
"clean": "rimraf lib",
|
||||
"build": "babel src --out-dir lib",
|
||||
"build:lib": "babel src --out-dir lib",
|
||||
"build:umd": "webpack src/index.js dist/redux-devtools.js --config webpack.config.development.js",
|
||||
"build:umd:min": "webpack src/index.js dist/redux-devtools.min.js --config webpack.config.production.js",
|
||||
"build:umd:react": "webpack src/react/index.js dist/redux-devtools.react.js --config webpack.config.development.js",
|
||||
"build:umd:react:min": "webpack src/react/index.js dist/redux-devtools.react.min.js --config webpack.config.production.js",
|
||||
"build": "npm run build:lib && npm run build:umd && npm run build:umd:min && npm run build:umd:react && npm run build:umd:react:min",
|
||||
"lint": "eslint src test examples",
|
||||
"test": "NODE_ENV=test mocha --compilers js:babel/register --recursive",
|
||||
"test:watch": "NODE_ENV=test mocha --compilers js:babel/register --recursive --watch",
|
||||
|
|
45
webpack.config.base.js
Normal file
45
webpack.config.base.js
Normal file
|
@ -0,0 +1,45 @@
|
|||
'use strict';
|
||||
|
||||
var webpack = require('webpack');
|
||||
|
||||
var reactExternal = {
|
||||
root: 'React',
|
||||
commonjs2: 'react',
|
||||
commonjs: 'react',
|
||||
amd: 'react'
|
||||
};
|
||||
|
||||
var reactReduxExternal = {
|
||||
root: 'ReactRedux',
|
||||
commonjs2: 'react-redux',
|
||||
commonjs: 'react-redux',
|
||||
amd: 'react-redux'
|
||||
};
|
||||
|
||||
var reduxExternal = {
|
||||
root: 'Redux',
|
||||
commonjs2: 'redux',
|
||||
commonjs: 'redux',
|
||||
amd: 'redux'
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
externals: {
|
||||
'react': reactExternal,
|
||||
'react-native': reactExternal,
|
||||
'react-redux': reactReduxExternal,
|
||||
'redux': reduxExternal
|
||||
},
|
||||
module: {
|
||||
loaders: [
|
||||
{ test: /\.js$/, loaders: ['babel-loader'], exclude: /node_modules/ }
|
||||
]
|
||||
},
|
||||
output: {
|
||||
library: 'ReduxDevTools',
|
||||
libraryTarget: 'umd'
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['', '.js']
|
||||
}
|
||||
};
|
14
webpack.config.development.js
Normal file
14
webpack.config.development.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
'use strict';
|
||||
|
||||
var webpack = require('webpack');
|
||||
var baseConfig = require('./webpack.config.base');
|
||||
|
||||
var config = Object.create(baseConfig);
|
||||
config.plugins = [
|
||||
new webpack.optimize.OccurenceOrderPlugin(),
|
||||
new webpack.DefinePlugin({
|
||||
'process.env.NODE_ENV': JSON.stringify('development')
|
||||
})
|
||||
];
|
||||
|
||||
module.exports = config;
|
20
webpack.config.production.js
Normal file
20
webpack.config.production.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
'use strict';
|
||||
|
||||
var webpack = require('webpack');
|
||||
var baseConfig = require('./webpack.config.base');
|
||||
|
||||
var config = Object.create(baseConfig);
|
||||
config.plugins = [
|
||||
new webpack.optimize.OccurenceOrderPlugin(),
|
||||
new webpack.DefinePlugin({
|
||||
'process.env.NODE_ENV': JSON.stringify('production')
|
||||
}),
|
||||
new webpack.optimize.UglifyJsPlugin({
|
||||
compressor: {
|
||||
screw_ie8: true,
|
||||
warnings: false
|
||||
}
|
||||
})
|
||||
];
|
||||
|
||||
module.exports = config;
|
Loading…
Reference in New Issue
Block a user