Created
June 2, 2017 21:54
-
-
Save marcuxyz/0bdf36ded42db10e78e011b355060ee4 to your computer and use it in GitHub Desktop.
Webpack para Reactjs
This file contains 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') | |
const ExtractTextPlugin = require('extract-text-webpack-plugin') | |
module.exports = { | |
entry: './src/index.jsx', | |
output: { | |
path: __dirname + '/public', | |
filename: './app.js' | |
}, | |
devServer: { | |
port: 8080, | |
contentBase: './public', | |
}, | |
resolve: { | |
extensions: ['', '.js', '.jsx'], | |
alias: { | |
modules: __dirname + '/node_modules' | |
} | |
}, | |
plugins: [ | |
new ExtractTextPlugin('app.css') | |
], | |
module: { | |
loaders: [{ | |
test: /.js[x]?$/, | |
loader: 'babel-loader', | |
exclude: /node_modules/, | |
query: { | |
presets: ['es2015', 'react'], | |
plugins: ['transform-object-rest-spread'] | |
} | |
}, { | |
test: /\.css$/, | |
loader: ExtractTextPlugin.extract('style-loader', 'css-loader') | |
}, { | |
test: /\.woff|.woff2|.ttf|.eot|.svg*.*$/, | |
loader: 'file' | |
}] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment