Skip to content

Instantly share code, notes, and snippets.

@neilbradley
Created February 12, 2019 21:41
Show Gist options
  • Save neilbradley/62fd5915163783e8dd50d0bd586fd162 to your computer and use it in GitHub Desktop.
Save neilbradley/62fd5915163783e8dd50d0bd586fd162 to your computer and use it in GitHub Desktop.
module.exports = {
plugins: [
require('postcss-import')({
plugins: [
require('stylelint')
]
}),
require('tailwindcss')('./tailwind.js'),
require('autoprefixer')(),
],
}
// Node modules
const path = require('path');
const webpack = require('webpack');
// Webpack plugins
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ManifestPlugin = require('webpack-manifest-plugin');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
const WorkboxPlugin = require('workbox-webpack-plugin');
// Config files
const pkg = require('./package.json');
module.exports = {
entry: './src/js/app.js',
mode: 'development',
output: {
filename: 'app.bundle.js',
path: __dirname+'/web/dist/js',
},
optimization: {
minimizer: [
new OptimizeCSSAssetsPlugin({})
]
},
plugins: [
new MiniCssExtractPlugin({
filename: "[name].css",
chunkFilename: "[id].css"
})
],
module: {
rules:[
{
test: /\.css$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {
// you can specify a publicPath here
// by default it use publicPath in webpackOptions.output
publicPath: './dist/css/'
}
},
"css-loader"
]
},
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
}
]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment