Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "use strict";
- var path = require("path");
- var Webpack = require("webpack");
- var ExtractTextPlugin = require("extract-text-webpack-plugin");
- var rupture = require('rupture');
- // Our configuration
- module.exports = {
- // Define the entry point
- context: __dirname + "/source/styles",
- entry: "./styles.js",
- // Output configuration
- output: {
- path: path.resolve(__dirname, "dist"),
- filename: "[name].js",
- },
- module: {
- rules: [
- // Inform CSS modules must be bundled in another file.
- {
- test: /\.css$/,
- use: ExtractTextPlugin.extract({
- fallback: 'style-loader',
- use: [
- {
- loader: 'css-loader',
- options: {
- importLoaders: 1
- }
- },
- 'postcss-loader'
- ]
- })
- },
- {
- test: /\.styl$/,
- use: ExtractTextPlugin.extract({
- fallback: 'style-loader',
- use: [
- {
- loader: 'css-loader',
- options: {
- importLoaders: 1
- }
- },
- 'postcss-loader',
- {
- loader: 'stylus-loader',
- options: {
- use: [rupture()],
- }
- }
- ]
- })
- },
- {
- test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
- use: "url-loader?limit=10000&mimetype=application/font-woff"
- },
- {
- test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
- use: "file-loader"
- }
- ]
- },
- plugins: [
- // Extract all CSS content to a file
- new ExtractTextPlugin("[name].css")
- ]
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement