Add webpack for css and js
This commit is contained in:
38
webpack.config.js
Normal file
38
webpack.config.js
Normal 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")
|
||||
],
|
||||
}
|
||||
Reference in New Issue
Block a user