fingerpan / vue-cli-plugin-dll

Vue CLI 3 plugin for Webpack DllPlugin/DllReferencePlugin
MIT License
76 stars 22 forks source link

Uncaught TypeError: __webpack_require__(...) is not a function #25

Open Arsync opened 5 years ago

Arsync commented 5 years ago

Just placed in my vue.config.js and was runned. In module.exports of vue.config.js:

pluginOptions: {
    dll: {
        entry: [
            'vue',
            'vue-i18n',
            'vue-router',
            'vuex',
            'vuex-router-sync',
            //'vuetify/lib'
            //'vuetify/src/stylus/app.styl',
            '@fortawesome/fontawesome-svg-core',
            '@fortawesome/vue-fontawesome',
            '@fortawesome/free-solid-svg-icons'
        ],
        open: process.env.NODE_ENV === 'development'
    }
}

In vue.config.js, configureWebpack:

target: TARGET_NODE ? 'node' : 'web',
output: {
  libraryExport: 'default',
  libraryTarget: TARGET_NODE
    ? 'commonjs2'
    : undefined
},

In browser's console:

vue.runtime.esm.js from dll-reference dll_library:1 Uncaught TypeError: __webpack_require__(...) is not a function
    at Object../node_modules/vue/dist/vue.runtime.esm.js (vue.runtime.esm.js from dll-reference dll_library:1)
    at __webpack_require__ (bootstrap:766)
    at fn (bootstrap:129)
    at Module../src/entry-client.js (entry-client.js:1)
    at __webpack_require__ (bootstrap:766)
    at fn (bootstrap:129)
    at Object.0 (client.7d0247628d2d6e6f84cf.js:35021)
    at __webpack_require__ (bootstrap:766)
    at bootstrap:901
    at bootstrap:901

In babel.config.js:

const presets = [[ '@vue/app', { modules: false, useBuiltIns: false } ]];
module.exports = {
    presets,
    plugins: [ '@babel/plugin-syntax-dynamic-import' ]
}
date13 commented 4 years ago

I have the same issue when use vuetify, how to resolve it ???