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

Error from UglifyJS #8

Closed
humet opened this issue Aug 28, 2018 · 6 comments
Closed

Error from UglifyJS #8

humet opened this issue Aug 28, 2018 · 6 comments
Labels

Comments

@humet
Copy link

humet commented Aug 28, 2018

Hi,

When I run this package through Webpack and through Uglify JS I am getting the following error:

Unexpected token name «key», expected punc «;»

I think it has to do with the ES5/6 compatibility.

Thanks

Rob

@notoriousb1t
Copy link
Owner

I don't see any ES6 stuff in the lib directory. Can you provide your webpack configuration?

@humet
Copy link
Author

humet commented Aug 28, 2018

I'm using Roots Sage, you can see the webpack configuration here: https://github.com/roots/sage/tree/9.0.0-beta.4/resources/assets/build

@notoriousb1t
Copy link
Owner

notoriousb1t commented Aug 29, 2018

I installed a test project using the vue-cli (which uses webpack internally) and did not encounter an issue running and doing a production build with polymorph-js. I can safely rule out that polymorph is built incorrectly.

What version of polymorph are you currently using? The current version is 0.2.2. Better yet, please provide your package.json. Perhaps this is an issue with a particular version of webpack?

@humet
Copy link
Author

humet commented Aug 29, 2018

I'm using 0.2.2. Here is my package.json

{
"name": "sage",
"version": "9.0.0",
"author": "Roots team@roots.io",
"homepage": "https://roots.io/sage/",
"private": true,
"repository": {
"type": "git",
"url": "git://github.com/roots/sage.git"
},
"bugs": {
"url": "https://github.com/roots/sage/issues"
},
"licenses": [
{
"type": "MIT",
"url": "http://opensource.org/licenses/MIT"
}
],
"browserslist": [
"last 2 versions",
"android 4",
"opera 12"
],
"stylelint": {
"extends": "stylelint-config-standard",
"rules": {
"no-empty-source": null,
"at-rule-no-unknown": [
true,
{
"ignoreAtRules": [
"extend",
"at-root",
"debug",
"warn",
"error",
"if",
"else",
"for",
"each",
"while",
"mixin",
"include",
"content",
"return",
"function"
]
}
]
}
},
"scripts": {
"build": "webpack --progress --config resources/assets/build/webpack.config.js",
"build:production": "webpack --progress -p --config resources/assets/build/webpack.config.js",
"build:profile": "webpack --progress --profile --json --config resources/assets/build/webpack.config.js",
"start": "webpack --hide-modules --watch --config resources/assets/build/webpack.config.js",
"rmdist": "rimraf dist",
"lint": "npm run -s lint:scripts && npm run -s lint:styles",
"lint:scripts": "eslint resources/assets/scripts resources/assets/build",
"lint:styles": "stylelint "resources/assets/styles/**/*.{css,sass,scss,sss,less}"",
"test": "npm run -s lint"
},
"engines": {
"node": ">= 6.9.4"
},
"devDependencies": {
"autoprefixer": "~7.2.5",
"browser-sync": "~2.23.6",
"browsersync-webpack-plugin": "^0.6.0",
"bs-html-injector": "~3.0",
"buble-loader": "^0.4.1",
"cache-loader": "~1.2.0",
"clean-webpack-plugin": "^0.1.18",
"copy-globs-webpack-plugin": "^0.2.0",
"css-loader": "^0.28.9",
"cssnano": "~v4.0.0-rc.2",
"eslint": "~4.17.0",
"eslint-loader": "~1.9",
"eslint-plugin-import": "~2.8.0",
"extract-text-webpack-plugin": "~3.0.2",
"file-loader": "^1.1.6",
"friendly-errors-webpack-plugin": "^1.6.1",
"imagemin-mozjpeg": "~7.0.0",
"imagemin-webpack-plugin": "~2.0.0",
"import-glob": "~1.5",
"node-sass": "~4.7.2",
"postcss-loader": "~2.1.0",
"postcss-safe-parser": "~3.0",
"resolve-url-loader": "~2.2.1",
"rimraf": "~2.6",
"sass-loader": "~6.0",
"style-loader": "^0.20.1",
"stylelint": "^8.4.0",
"stylelint-config-standard": "~18.0.0",
"stylelint-webpack-plugin": "^0.10.1",
"url-loader": "^0.6.2",
"webpack": "~3.10.0",
"webpack-assets-manifest": "^1.0.0",
"webpack-dev-middleware": "~2.0.4",
"webpack-hot-middleware": "~2.21.0",
"webpack-merge": "~4.1.1",
"yargs": "~11.0.0"
},
"dependencies": {
"bootstrap": "^4.0.0-beta",
"jquery": "^3.3.1",
"polymorph-js": "^0.2.2",
"popmotion": "^8.3.6",
"popper.js": "~1.11"
}
}

@notoriousb1t
Copy link
Owner

I think this might be an issue with that particular version of webpack + the uglify plugin: webpack-contrib/uglifyjs-webpack-plugin#78 (comment)

The resolution I see in those is to upgrade webpack or the plugin.

Alternatively, the npm package ships with a dist folder. You can configure webpack to alias node_modules/polymorph-js/dist/polymorph.js and that should work around the webpack issue.

@notoriousb1t
Copy link
Owner

Closing due to inactivity. If you are still having issues, please reopen this with further details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants