Created
February 12, 2019 21:41
-
-
Save neilbradley/62fd5915163783e8dd50d0bd586fd162 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
plugins: [ | |
require('postcss-import')({ | |
plugins: [ | |
require('stylelint') | |
] | |
}), | |
require('tailwindcss')('./tailwind.js'), | |
require('autoprefixer')(), | |
], | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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