UNPKG

@codercy1995/cy-cli

Version:

34 lines (33 loc) 881 B
const MiniCssExtractPlugin = require('mini-css-extract-plugin') const path = require('path'); const cwd = process.cwd(); const comments = require(path.join(cwd, 'components.json')); module.exports = { mode: 'production', entry: components, output: { path: path.resolve(cwd, 'lib'), filename: '[name].js', libraryTarget: 'commonjs' //决定打包后的模式 }, module: { rules: [ { test: /\.vue$/, loader: 'vue-loader' }, { test: /\.css$/, use: [ MiniCssExtractPlugin.loader, 'css-loader' ] } ] }, plugins: [ new MiniCssExtractPlugin({ filename: 'theme-chalk/[name].css' }) ] };