Skip to content

Instantly share code, notes, and snippets.

@LuoZijun
Last active February 20, 2017 05:32
Show Gist options
  • Save LuoZijun/609c2774312299b3f287f1164172f228 to your computer and use it in GitHub Desktop.
Save LuoZijun/609c2774312299b3f287f1164172f228 to your computer and use it in GitHub Desktop.
Demo Config
{
"name": "webapp",
"version": "1.0.0",
"description": "web application",
"keywords": [
"web",
"application"
],
"author": "",
"license": "",
"main": "",
"repository": {
"type": "git",
"url": ""
},
"devDependencies": {
"babel-core": "6.14.0",
"babel-loader": "6.2.9",
"babel-preset-latest": "6.16.0",
"babel-preset-react": "6.11.1",
"json-loader": "0.5.4",
"source-map-loader": "^0.1.5",
"webpack": "1.14.0"
},
"dependencies": {
"web3": "0.18.2"
},
"scripts": {
"installll": "cnpm install -d"
}
}
var webpack = require("webpack");
module.exports = {
entry: "./src/main.js",
output: {
filename: "bundle.min.js",
path: __dirname + "/build"
},
// Enable sourcemaps for debugging webpack's output.
devtool: "source-map",
plugins: [
new webpack.optimize.UglifyJsPlugin({minimize: true})
],
resolve: {
extensions: ['', '.js', '.jsx', '.json']
},
module: {
loaders: [
// All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'.
{ test: /\.js|jsx$/, loaders: ['babel-loader'] },
{ test: /\.json$/, loader: "json-loader" },
],
preLoaders: [
// All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'.
{ test: /\.js$/, loader: "source-map-loader" }
]
},
// When importing a module whose path matches one of the following, just
// assume a corresponding global variable exists and use that instead.
// This is important because it allows us to avoid bundling all of our
// dependencies, which allows browsers to cache those libraries between builds.
externals: {
"react" : "React",
"react-dom": "ReactDOM",
"antd" : "antd",
"web3" : "Web3"
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment