Last active
March 8, 2017 15:02
-
-
Save bummzack/3c2ce81fed317837a96de4918212c5d4 to your computer and use it in GitHub Desktop.
Minimalistic Webpack 2.x config
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
{ | |
"name": "meetup", | |
"version": "1.0.0", | |
"description": "Webpack React Setup for SilverStripe Projects", | |
"main": "index.js", | |
"author": "Roman Schmid", | |
"license": "MIT", | |
"scripts": { | |
"build": "webpack --bail" | |
}, | |
"devDependencies": { | |
"babel-core": "^6.23.1", | |
"babel-loader": "^6.4.0", | |
"babel-preset-es2015": "^6.22.0", | |
"babel-preset-react": "^6.23.0", | |
"webpack": "^2.2.1" | |
} | |
} |
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
const webpack = require('webpack'); | |
module.exports = { | |
entry: { | |
'index' : `./src/index.jsx` | |
}, | |
output: { | |
path: './dist', | |
filename: '[name].js', | |
}, | |
resolve: { | |
modules: [ 'node_modules', 'src' ], | |
extensions: [".js", ".jsx", ".scss", ".css", ".html"] | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.(js|jsx)$/, | |
exclude: [/node_modules/], | |
use: { | |
loader: 'babel-loader', | |
options: { | |
presets: ['es2015', 'react'], | |
comments: false, | |
} | |
} | |
} | |
] | |
}, | |
plugins: [], | |
devtool: "source-map" | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment