iOS 10白屏 配置

const path = require(‘path‘);
const cwd = process.cwd();
const VueLoaderPlugin = require(‘vue-loader/lib/plugin‘);
const {
    getHtmlWebpackPlugins,
    getEntry
} = require(‘./utils‘);
const TerserPlugin = require(‘terser-webpack-plugin‘);
const entries = getEntry();

const config = {
    entry: entries,
    resolve: {
        extensions: [‘.js‘, ‘.vue‘],
    },
    optimization: {
        splitChunks: {
            chunks: ‘async‘ // initial(初始块)、async(按需加载块)、all(全部块)
        },
        minimize: true,
        minimizer: [
            new TerserPlugin({
                terserOptions: {
                    safari10: true,
                },
            }),
        ],
    },
    externals: {
        vue: ‘Vue‘
    },
    module: {
        rules: [{
                test: /\.vue$/,
                include: path.resolve(cwd, ‘src‘),
                use: [‘vue-loader‘]
            },
            {
                test: /\.(css|postcss)$/,
                use: [‘vue-style-loader‘, ‘css-loader‘, {
                    loader: ‘postcss-loader‘,
                }, ]
            },
            {
                test: /\.(js)$/,
                include: path.resolve(cwd, ‘src‘),
                use: [{
                    loader: ‘babel-loader‘,
                    options: {
                        presets: [
                            [‘@babel/preset-env‘, {
                                targets: {
                                    ios: 9,
                                    android: 5
                                }
                            }]
                        ],
                        plugins: [
                            ["@babel/transform-runtime"]
                        ]
                    }
                }]
            }
        ]
    },
    plugins: [
        new VueLoaderPlugin(),
    ]
};

module.exports = config;

npm install terser-webpack-plugin -dev --save

iOS 10白屏 配置

上一篇:SaaS战火点燃 微信再遇阿里、网易


下一篇:证件阅读器API接口SDK二次开发APP应用