12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- /**
- * @Author: Bachir Soussi Chiadmi <bach>
- * @Date: 11-04-2017
- * @Email: bachir@figureslibres.io
- * @Last modified by: bach
- * @Last modified time: 16-04-2017
- * @License: GPL-V3
- */
- var webpack = require('webpack');
- var ExtractTextPlugin = require('extract-text-webpack-plugin');
- module.exports = {
- entry: ["./assets/main.js", "./assets/main.scss"], //, "./scss/main.scss"
- output: {
- path: __dirname + "/assets/dist/",
- filename: "main.js"
- },
- devtool: 'source-map',
- module: {
- rules: [
- /* your other rules for JavaScript transpiling go in here */
- {
- // regular css files
- test: /\.css$/,
- use: ExtractTextPlugin.extract({ loader: 'css-loader?importLoaders=1', }),
- },
- {
- // sass / scss loader for webpack
- test: /\.(sass|scss)$/,
- use: ExtractTextPlugin.extract(['css-loader', 'sass-loader'])
- },
- {
- // fonts
- test: /\.(eot|svg|ttf|woff|woff2)$/,
- use: "file-loader?name=fonts/[name].[ext]"
- },
- ]
- },
- plugins: [
- new ExtractTextPlugin({
- // define where to save the file
- filename: '[name].css', allChunks: true,
- }),
- new webpack.optimize.UglifyJsPlugin({
- compress: {
- warnings: false
- }
- })
- ],
- watch: true
- };
|