123456789101112131415161718192021222324252627282930313233343536 |
- const webpack = require('webpack')
- const path = require('path')
- const version = require('./package.json').version
- const argv = require('yargs').argv
- let channel = argv.channel || 'beibaoyx'
- module.exports = {
- entry: {
- [`huosdk-${version}`]: './src/index.js'
- },
- mode: 'production',
- module: {
- rules: [
- {
- test: /\.js$/,
- exclude: /node_modules/,
- loader: 'babel-loader',
- options: {
- presets: ['env'],
- plugins: ['transform-object-rest-spread']
- }
- }
- ]
- },
- output: {
- path: path.resolve(__dirname, `./dist/${channel}`),
- filename: '[name].js',
- libraryTarget: "commonjs2"
- },
- plugins: [
- new webpack.DefinePlugin({
- BUILD_ENV: JSON.stringify(channel)
- })
- ]
- }
|