Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const webpack = require('webpack');
const MiniPlugin = require('mini-program-webpack-loader').plugin;
const baseResolve = require('./webpack.config.base.resolve');
const baseLoaders = require('./webpack.config.base.loaders');
module.exports = {
mode: 'development',
target: 'node',
devtool: false,
watchOptions: {
ignored: /node_modules/,
poll: 1000
},
resolve: baseResolve,
module: { rules: baseLoaders },
optimization: {
minimize: true,
// 始终开启压缩,以保证在开发模式可以预览
const path = require('path');
const merge = require('webpack-merge');
const MiniProgramPlugin = require('mini-program-webpack-loader').plugin;
const CopyWebpackPlugin = require('copy-webpack-plugin');
const resolve = (file) => path.resolve(__dirname, '../', file);
const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
global.context = resolve('src')
const baseConfig = require('./webpack.config.base');
module.exports = merge(baseConfig, {
context: global.context,
entry: resolve('src/app.json'),
output: {
path: resolve('dist')
},
plugins: [
new MiniProgramPlugin({
const path = require('path');
const merge = require('webpack-merge');
const MiniProgramPlugin = require('mini-program-webpack-loader').plugin;
const CopyWebpackPlugin = require('copy-webpack-plugin');
const resolve = (file) => path.resolve(__dirname, '../', file);
global.context = resolve('src/plugin');
const baseConfig = require('./webpack.config.base');
module.exports = [merge(baseConfig, {
context: global.context,
entry: resolve('src/plugin/plugin.json'),
output: {
path: resolve('dist/plugin')
},
plugins: [
new MiniProgramPlugin({
forPlugin: true