Created
March 24, 2017 12:30
-
-
Save MartinMuzatko/2873b52fed204bd6e8aaaa94527e34a9 to your computer and use it in GitHub Desktop.
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
var webpack = require('webpack') | |
var ExtractTextPlugin = require("extract-text-webpack-plugin") | |
var path = require('path'); | |
module.exports = { | |
entry: "./src/index.js", | |
output: { | |
path: path.resolve(__dirname, ''), // string | |
filename: "[name].js", // string | |
publicPath: "/", // string | |
}, | |
module: { | |
// configuration regarding modules | |
rules: [ | |
//{ test: /\.js$/, loader: 'source-map', enforce: 'pre' }, | |
{ test: /\.html$/, loader: ['riotjs'], enforce: 'pre' }, | |
{ test: /\.js|\.html$/, loader: 'babel', options: { presets: 'es2015-riot' }}, | |
//{ test: /\.(jpe?g|png|gif|mp4)$/i, loader: 'file?name=img/[name].[ext]'}, | |
{ test: /\.ttf$/, loader: `file?name=fonts/[name].[ext]`}, | |
{ | |
test: /\.less$/, use: ExtractTextPlugin.extract( | |
[ | |
{loader:'raw'}, | |
{loader:'less'} | |
] | |
), | |
} | |
], | |
}, | |
resolveLoader: { | |
moduleExtensions: ["-loader"] | |
}, | |
plugins: [ | |
new ExtractTextPlugin("css/[name].css") | |
], | |
devtool: "source-map", // enum | |
context: __dirname, // string (absolute path!) | |
target: "web", // enum | |
stats: { //object | |
assets: true, | |
colors: true, | |
errors: true, | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment