Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const webpack = require('webpack');
- const path = require('path');
- const ExtractTextPlugin = require("extract-text-webpack-plugin");
- let config = {
- entry: {
- main: [
- './js/theme.js',
- './css/theme.scss'
- ]
- },
- output: {
- path: path.resolve(__dirname, '../assets/js'),
- filename: 'theme.js'
- },
- module: {
- rules: [
- {
- test: /\.js/,
- loader: 'babel-loader'
- },
- {
- test: /\.scss$/,
- use: ExtractTextPlugin.extract({
- fallback: 'style-loader',
- use: [
- {
- loader: 'css-loader',
- options: {
- minimize: false
- }
- },
- 'postcss-loader',
- 'sass-loader'
- ]
- })
- },
- {
- test: /.(png|woff(2)?|eot|ttf|svg)(\?[a-z0-9=\.]+)?$/,
- use: [
- {
- loader: 'file-loader',
- options: {
- name: '../css/[hash].[ext]'
- }
- }
- ]
- },
- {
- test : /\.css$/,
- use: ['style-loader', 'css-loader', 'postcss-loader']
- }
- ]
- },
- externals: {
- prestashop: 'prestashop',
- $: '$',
- jquery: 'jQuery'
- },
- plugins: [
- new ExtractTextPlugin(path.join('..', 'css', 'theme.css'))
- ]
- };
- config.plugins.push(
- new webpack.optimize.UglifyJsPlugin({
- sourceMap: false,
- compress: {
- sequences: true,
- conditionals: true,
- booleans: true,
- if_return: true,
- join_vars: true,
- drop_console: true
- },
- output: {
- comments: false
- },
- minimize: false
- })
- );
- module.exports = config;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement