vue-router.common.js:1820 Uncaught (in promise) TypeError: Cannot read property '__esModule' of undefined
at isESModule (vue-router.common.js:1820)
at vue-router.common.js:1749
at vue-router.common.js:1835
at <anonymous>
//index js引用顺序
<script type="text/javascript" src="dist/js/common.js.js"></script>
<script type="text/javascript" src="dist/js/framelist.js"></script>
<script type="text/javascript" src="dist/js/main.js"></script>
//vue-router 路由中使用的异步组件代码
const FrameList= () => import(/ webpackChunkName: "framelist" /'../views/framelist/Framelist.vue').then(m => m.default);
//webpack的配置
entry: {
main: ["babel-polyfill", './src/main.js'],
},
output: {
libraryTarget: 'umd',
path: path.resolve(__dirname, './dist'),
//很关键 决定你打包后的静态资源是否能正确引用
//publicPath: '/cqpt/dist/', //打包发布
publicPath: '/dist/', //打包开发(不影响热加载)
filename: 'js/[name].js',
chunkFilename: "js/[name].js"
},
plugins: [
new webpack.ProvidePlugin({
$: 'jquery'
}),
new ExtractTextPlugin({
filename: "css/styles.css",
allChunks: true
}),
new HtmlWebpackPlugin({
title: "xxxxxx",
template: "index.html",
favicon: resolveApp('favicon.ico'),
inject: true,
hash: true,
}),
new webpack.optimize.CommonsChunkPlugin("common.js"),
],