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

Source order is not respected when using Grunt templates #372

Closed
argyleink opened this issue Nov 20, 2015 · 1 comment
Closed

Source order is not respected when using Grunt templates #372

argyleink opened this issue Nov 20, 2015 · 1 comment

Comments

@argyleink
Copy link

This is maintained:

module.exports = (grunt) ->
  prod:
    options:
      banner:     "<%= banner %>"
      screwIE8:   true
      compress:   drop_console: true
    files: 
      "<%= dirs.build %>/js/app.js": [
        "js/bower/material-design-lite/material.js"
        "js/app.js"
      ]

This works if app.js is not modified:

module.exports = (grunt) ->
  prod:
    options:
      banner:     "<%= banner %>"
      screwIE8:   true
      compress:   drop_console: true
    files: 
      "<%= dirs.build %>/js/app.js":"<%= app.js %>"

This DOES NOT work, src order is lost:

module.exports = (grunt) ->
  prod:
    options:
      banner:     "<%= banner %>"
      screwIE8:   true
      compress:   drop_console: true
    files: 
      "<%= dirs.build %>/js/app.js":"<%= app.js.map((file)=>`app/${file}`) %>"

If i use uglifyjs2 straight from shell using the below, it works. Therefore, I believe it's grunt-contrib-uglify's fault for the reordering of src code during concat. Please advise.

./node_modules/uglify-js/bin/uglifyjs <%= app.js.map((file)=>app/${file}).toString().replace(',', ' ') %> -o build/dev/js/app.min.js

@XhmikosR
Copy link
Member

#271

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