three-minifier icon indicating copy to clipboard operation
three-minifier copied to clipboard

Usage with nuxt break other libraries export

Open liqueflies opened this issue 3 years ago • 1 comments

Hello, I've tried this plugin with nuxt.

The result of threejs was perfect but at the same time I had some problem with my other libraries when the build has done.

WARN  in ./.nuxt/portal-vue.js

"export 'default' (imported as 'PortalVue') was not found in 'portal-vue'

 WARN  in ./plugins/vee-validate.js

"export 'extend' was not found in 'vee-validate'

my config:

build: {
    analyze: true,
    transpile: ['vee-validate/dist/rules'],
    plugins: [threeMinifier],
    loaders: {
      cssModules: {
        modules: {
          localIdentName:
            process.env.NODE_ENV !== 'production'
              ? '[path][name]---[local]---[hash:base64:5]'
              : '[hash:base64:5]',
        },
      },
    },
    extend(config, ctx) {
      config.resolve.plugins = [threeMinifier.resolver]
      config.module.rules.push({
        test: /\.(glsl|vs|fs|vert|frag)$/,
        exclude: /node_modules/,
        use: ['raw-loader', 'glslify-loader'],
      })
    },
  },

Let me know if I can help and thank you!

L.

liqueflies avatar Dec 29 '20 18:12 liqueflies

I'm not familiar with nuxt. Could you please provide a demo project so that I can reproduce your problem?

yushijinhun avatar Dec 30 '20 16:12 yushijinhun