Add webpack for css and js

This commit is contained in:
Tom Raithel
2017-01-25 11:44:16 +01:00
parent 9d6402d7fd
commit 74bfec3366
11 changed files with 58 additions and 5 deletions

38
webpack.config.js Normal file
View File

@@ -0,0 +1,38 @@
var path = require('path');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
const cssLoader = ExtractTextPlugin.extract({
loader: "css-loader"
});
module.exports = {
entry: {
bundle: './js/radar.js',
},
output: {
path: path.join(__dirname, 'dist'),
filename: '[name].js',
},
module: {
rules: [
{
test: /\.js?$/,
include: [
path.resolve(__dirname, "js")
],
loader: "babel-loader",
},
{
test: /\.css?$/,
include: [
path.resolve(__dirname, "styles")
],
loader: cssLoader,
},
],
},
plugins: [
new ExtractTextPlugin("styles.css")
],
}