Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const ExtractTextPlugin = require('extract-text-webpack-plugin');
- const webpack = require('webpack');
- module.exports = {
- entry: {
- global: ['./src/assets/js/global.js', './src/assets/js/anotherfile.js'],
- i18n: ['./src/lib/js/i18n.js'],
- css: ['./src/assets/scss/screen.scss']
- },
- output: {
- filename: 'app/assets/js/[name].bundle.js'
- },
- module: {
- rules: [
- {
- test: /\.js$/,
- loader: 'babel-loader',
- exclude: [/node_modules/],
- query: {
- presets: ['es2015']
- }
- },
- { // css / sass / scss loader for webpack
- test: /\.(css|sass|scss)$/,
- use: ExtractTextPlugin.extract({
- use: ['css-loader', 'sass-loader'],
- })
- }
- ]
- },
- plugins: [
- new webpack.optimize.CommonsChunkPlugin({
- name: 'vendor'
- }),
- new ExtractTextPlugin({ // define where to save the file
- filename: 'app/assets/css/[name].bundle.css',
- allChunks: true,
- }),
- ],
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement