Skip to content

Commit

Permalink
feat: add client nocss bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidRouyer authored and euvl committed Jul 8, 2020
1 parent f6e3cc2 commit a43b843
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 154 deletions.
56 changes: 56 additions & 0 deletions build/webpack.client-no-css.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
const path = require('path')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const VueLoaderPlugin = require('vue-loader/lib/plugin')

module.exports = {
mode: 'production',
entry: path.resolve(__dirname, '../src/index.js'),
devtool: 'source-map',
output: {
library: 'vue-js-modal',
libraryTarget: 'umd',
path: path.resolve(__dirname, '../dist'),
publicPath: '/dist/',
filename: 'index.nocss.js'
},
resolve: {
extensions: ['.js']
},
optimization: {
minimizer: [
new UglifyJsPlugin({
cache: true,
parallel: true,
sourceMap: true
}),
new OptimizeCSSAssetsPlugin({
canPrint: true
})
]
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.css$/,
use: [MiniCssExtractPlugin.loader, 'css-loader']
}
]
},
plugins: [
new VueLoaderPlugin(),
new MiniCssExtractPlugin({
filename: 'styles.css'
})
]
}
2 changes: 2 additions & 0 deletions dist/index.nocss.js

Large diffs are not rendered by default.

155 changes: 1 addition & 154 deletions dist/styles.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
},
"scripts": {
"build:client": "webpack --config ./build/webpack.client.config.js --progress --hide-modules",
"build:client-no-css": "webpack --config ./build/webpack.client-no-css.config.js --progress --hide-modules",
"build:ssr": "webpack --config ./build/webpack.ssr.config.js --progress --hide-modules",
"build:ssr-no-css": "webpack --config ./build/webpack.ssr-no-css.config.js --progress --hide-modules",
"lint:js": "eslint --ext js --ext jsx --ext vue src",
Expand Down

0 comments on commit a43b843

Please sign in to comment.