在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML/ vue+webpack懶加載打包時候為什么打不組件模塊?

vue+webpack懶加載打包時候為什么打不組件模塊?

        //main.js中引用了  定義路由的js文件
        
        //異步組件
        const FrameCore = () => import('../views/form/frame/FrameCore.vue');
        {
            path: '/framecore:form?',
            component:FrameCore,
            name: 'framecore',
            children: [
                //更多操作(提成反結(jié)賬),路由跳轉(zhuǎn)打開新界面或彈框
                {path: '/noCheckOut_RY:form?', component: NoCheckOut_RY, name: 'noCheckOut_RY'},
                {path: '/noCheckOut_DN:form?', component: NoCheckOut_DN, name: 'noCheckOut_DN'},
            ],
        },
        {
            path: '/treeformview:form?',
            component:resolve => require(['../views/form/frame/TreeFormView.vue'], resolve) ,
            name: 'treeformview'
        },
        //webpack的配置
        entry: {
            main: ["babel-polyfill", './src/main.js'],

        },
        output: {
            libraryTarget: 'umd',
            path: path.resolve(__dirname, './dist'),
            //publicPath: '/cqpt/dist/',    //打包發(fā)布
            publicPath: '/dist/',           //打包開發(fā)(不影響熱加載)
            filename: 'js/[name].js',
            chunkFilename: "js/[name].[chunkhash:8].js"
        },
        
        plugins: [
            new webpack.ProvidePlugin({
                $: 'jquery'
            }),
            new ExtractTextPlugin("css/styles.css"),
            new HtmlWebpackPlugin({
              
                template: "index.html",
                favicon: resolveApp('favicon.ico'),
                inject: true,
                hash: true
            }),
            new webpack.optimize.CommonsChunkPlugin("common.js"),

        ],
回答
編輯回答
我甘愿

異步組件的引用方式應(yīng)該是這樣的
const FrameList= () => import(/ webpackChunkName: "framelist" /'../views/framelist/Framelist.vue').then(m => m.default);

2017年9月2日 11:58