Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimize issue #25

Closed
akubasa opened this issue Mar 2, 2017 · 4 comments
Closed

Minimize issue #25

akubasa opened this issue Mar 2, 2017 · 4 comments

Comments

@akubasa
Copy link

akubasa commented Mar 2, 2017

When I run webpack build with Uglifyjs plugin or --optimize-minimize it gives me following error

ERROR in build.js from UglifyJs
SyntaxError: Unexpected token: name (warn) [./~/vue-awesome/util.js:3,0][build.js:...

When I run the build withput minification or dev Its working great.

I am importing the Icon in my components, I also tried the global import, still not working I tried ES5 and ES6

I am now importing like:

require('vue-awesome/icons/search');
require('vue-awesome/icons/times');
var Icon = require('vue-awesome/components/Icon.vue');

And then I define in module.exports

    components: {
        'icon': Icon
    },

It is working but only in dev builds, Am I missing something?

@akubasa
Copy link
Author

akubasa commented Mar 2, 2017

As a temporary solution I just removed the utli import in the Icon.vue file and removed the "warn" on line 82 (I am using current version)

@akubasa akubasa changed the title Minification issue Minimize issue Mar 2, 2017
@Justineo
Copy link
Owner

Justineo commented Mar 3, 2017

That's probably your file is not transpiled into ES5 before you minimize it. Did you follow the instructions in readme?

@akubasa
Copy link
Author

akubasa commented Mar 3, 2017

Thank you for your fast response.
I think this will be the issue. I will try later today and let you know.

@akubasa
Copy link
Author

akubasa commented Mar 3, 2017

this babel config worked for me

{
    test: /\.js$/,
    loader: 'babel-loader',
    exclude: /node_modules(?![\\/]vue-awesome[\\/])/,
    include: ['src', path.resolve(__dirname), 'node_modules/vue-awesome']
},

@akubasa akubasa closed this as completed Mar 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants