Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Warnings on config override #878

Closed
ocombe opened this issue Sep 26, 2014 · 10 comments
Closed

Warnings on config override #878

ocombe opened this issue Sep 26, 2014 · 10 comments

Comments

@ocombe
Copy link

ocombe commented Sep 26, 2014

I'm using the override option to create a specialized build of my app that doesn't include all my libs from bower_components (almost, but not all), and when I watch it with the --env setting I get a lot of warning 26 Sep 11:39:48 - warn: 'bower_components\.....' compiled, but not written. Check your javascripts.joinTo config.
I know that it doesn't use all my libs, it's intentional. Is there anything I could do to remove those warnings in my override ? It's really annoying...
I've checked the brunch source code but there doesn't seem to be an option for that. I only found the config.notification hidden option that doesn't work or doesn't apply to those warnings...

@es128
Copy link
Member

es128 commented Sep 26, 2014

See #872. Brunch v1.7.16 was an attempt at suppressing these warnings when the files would be included in any env, not just the current one. Are you running the latest version?

If so, are you doing something other than modifying your joinTo config to turn off certain deps?

@ocombe
Copy link
Author

ocombe commented Sep 26, 2014

Yes I'm using 1.7.16
Here is my complete brunch config file:

// See docs at https://github.com/brunch/brunch/blob/master/docs/config.md
exports.config = {
    modules: {
        definition: false,
        wrapper: false
    },
    paths: {
        "public": '../frontweb/public',
        "watched": ['app', 'bookmarklet', 'vendor']
    },
    files: {
        javascripts: {
            joinTo: {
                'js/app.js': /^app/,
                'js/vendor.js': /^(vendor|bower_components)/,
                'js/bkmLoader.js': /^bookmarklet(\\|\/)bkmLoader\.js/,
                'js/bkm-vendor.js': [
                    // divers
                    'bower_components/lodash/dist/lodash.js',
                    'bower_components/modernizr/modernizr.js',
                    'bower_components/localforage/dist/localforage.min.js',
                    'bower_components/keydrown/dist/keydrown.min.js',
                    'bower_components/velocity/velocity.js',

                    // angular
                    'bower_components/angular-cookies/angular-cookies.js',
                    'bower_components/angular-resource/angular-resource.js',
                    'bower_components/angular-sanitize/angular-sanitize.js',
                    'bower_components/angular-ui-router/release/angular-ui-router.js',
                    'bower_components/angular-translate/angular-translate.js',
                    'bower_components/angular-translate-storage-cookie/angular-translate-storage-cookie.js',
                    'bower_components/angular-translate-storage-local/angular-translate-storage-local.js',
                    'bower_components/angular-localForage/dist/angular-localForage.js',
                    'bower_components/ocModal/dist/ocModal.js',
                    'bower_components/ng-file-upload/angular-file-upload.js'
                ],
                'js/bookmarklet.js': [
                    'app/commons/i18n/**/*.js',
                    'app/commons/js/services/translateProvider.js',
                    'app/commons/js/directives/loader.js',
                    'app/logged/js/directives/radio.js',
                    'app/logged/js/directives/checkbox.js',
                    'app/logged/js/services/api.js',
                    'app/logged/js/services/user.js',
                    'app/logged/js/services/friends.js',
                    'app/logged/js/services/oox.js',
                    'app/logged/js/services/params.js',
                    'app/commons/js/services/parseUri.js',
                    'app/commons/js/services/postMsg.js',
                    'app/logged/js/filters/folderList.js',
                    'app/logged/js/animations/fade.js',
                    'app/logged/js/directives/sb.js',
                    'app/logged/js/directives/dropdown.js',
                    'app/logged/js/directives/linkedTo.js',
                    'app/logged/js/directives/colorLine.js',
                    'app/commons/js/directives/validationStatus.js',
                    'app/logged/js/directives/ngAutocomplete.js',
                    'app/commons/js/directives/maxLength.js',
                    'app/logged/js/services/safeApply.js',
                    'bookmarklet/app/**/*.js'
                ]
            }
        },
        stylesheets: {
            joinTo: {
                'css/app.css': /^app/,
                'css/bkm-app.css': /^bookmarklet/
            }
        }
    },

    plugins: {
        autoprefixer: {
            browsers: [
                "last 2 version",
                "> 1%", // browsers with > 1% usage
                "ie >= 10"
            ],
            cascade: false
        }
    },

    conventions: {
        assets: function(path) {
            path = path.replace(/\\/g, '/');
            if((path.indexOf('app/assets') > -1 || path.indexOf('bookmarklet/app/assets') > -1 || path.indexOf('dist/') === 0) && path.indexOf('sprites/') === -1) {
                return true;
            }
        }
    },

    sourceMaps: true,

    workers: {
        enabled: false
    },

    overrides: {
        production: {
            optimize: true,
            sourceMaps: false,
            paths: {
                "public": 'public'
            }
        },
        'dev-start': {
            paths: {
                "public": '../frontweb/target/scala-2.10/classes/public'
            }
        },
        admin: {
            paths: {
                "public": '../frontweb/public-admin',
                "watched": ['admin']
            },
            files: {
                javascripts: {
                    joinTo: {
                        'js/admin-app.js': /^admin/,
                        'js/admin-vendor.js': [
                            // divers
                            'bower_components/lodash/dist/lodash.js',
                            'bower_components/modernizr/modernizr.js',
                            'bower_components/localforage/dist/localforage.min.js',
                            'bower_components/keydrown/dist/keydrown.min.js',
                            'bower_components/velocity/velocity.js',

                            // angular
                            'bower_components/angular-cookies/angular-cookies.js',
                            'bower_components/angular-resource/angular-resource.js',
                            'bower_components/angular-sanitize/angular-sanitize.js',
                            'bower_components/angular-ui-router/release/angular-ui-router.js',
                            'bower_components/angular-localForage/dist/angular-localForage.js',
                            'bower_components/ocModal/dist/ocModal.js',
                            'bower_components/ng-file-upload/angular-file-upload.js',
                            'bower_components/angular-material/angular-material.js'
                        ]
                    }
                },
                stylesheets: {
                    joinTo: {
                        'css/admin-app.css': /^admin/
                    }
                }
            },
            conventions: {
                assets: /^admin(\\|\/)assets/
            }
        }
    }
};

The problem is with my override admin.

@ocombe
Copy link
Author

ocombe commented Sep 26, 2014

For now I added a new js file in the joinTo: 'js/ignoreThis.js': /^bower_components/ until we can figure this thing out :)

@es128
Copy link
Member

es128 commented Sep 26, 2014

Can you provide the list of warnings so I can see which files are not being filtered out properly?

@ocombe
Copy link
Author

ocombe commented Sep 26, 2014

Sure, here it is:

26 Sep 16:07:35 - warn: 'bower_components\angular-translate\angular-translate.js' compiled, but not written. Check your javascripts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\angular-animate\angular-animate.js' compiled, but not written. Check your javascripts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\angular-translate-storage-cookie\angular-translate-storage-cookie.js' compiled, but not written. Check your
javascripts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\eventEmitter\EventEmitter.js' compiled, but not written. Check your javascripts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\eventie\eventie.js' compiled, but not written. Check your javascripts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\angular-touch\angular-touch.js' compiled, but not written. Check your javascripts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\hammerjs\hammer.js' compiled, but not written. Check your javascripts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\moment\moment.js' compiled, but not written. Check your javascripts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\select2\select2.js' compiled, but not written. Check your javascripts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\angular-cookies\angular-cookies.js' compiled, but not written. Check your javascripts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\angular-moment\angular-moment.js' compiled, but not written. Check your javascripts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\angular-translate-storage-local\angular-translate-storage-local.js' compiled, but not written. Check your ja
vascripts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\imagesloaded\imagesloaded.js' compiled, but not written. Check your javascripts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\jquery-ui-touch-punch\jquery.ui.touch-punch.js' compiled, but not written. Check your javascripts.joinTo con
fig.
26 Sep 16:07:35 - warn: 'bower_components\modernizr\modernizr.js' compiled, but not written. Check your javascripts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\jquery-ui\ui\widget.js' compiled, but not written. Check your javascripts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\jquery-ui\ui\core.js' compiled, but not written. Check your javascripts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\jquery-ui\ui\mouse.js' compiled, but not written. Check your javascripts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\jquery-ui\ui\draggable.js' compiled, but not written. Check your javascripts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\jquery-ui\ui\droppable.js' compiled, but not written. Check your javascripts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\moment\locale\fr.js' compiled, but not written. Check your javascripts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\moment\locale\es.js' compiled, but not written. Check your javascripts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\angular-carousel\dist\angular-carousel.js' compiled, but not written. Check your javascripts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\angular-ui-select2\src\select2.js' compiled, but not written. Check your javascripts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\jcrop\js\jquery.Jcrop.js' compiled, but not written. Check your javascripts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\ocModal\dist\ocModal.js' compiled, but not written. Check your javascripts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\skrollr\dist\skrollr.min.js' compiled, but not written. Check your javascripts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\ocLazyLoad\dist\ocLazyLoad.js' compiled, but not written. Check your javascripts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\bootstrap-sass\vendor\assets\javascripts\bootstrap\transition.js' compiled, but not written. Check your java
scripts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\bootstrap-sass\vendor\assets\javascripts\bootstrap\tooltip.js' compiled, but not written. Check your javascr
ipts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\bootstrap-sass\vendor\assets\javascripts\bootstrap\popover.js' compiled, but not written. Check your javascr
ipts.joinTo config.
26 Sep 16:07:35 - warn: 'bower_components\bootstrap-sass\vendor\assets\javascripts\bootstrap\collapse.js' compiled, but not written. Check your javasc
ripts.joinTo config.

And my bower.json file, in case you need it:

{
  "name": "??",
  "version": "0.1.0",
  "dependencies": {
    "angular-resource": "1.3.0-rc.3",
    "angular-sanitize": "1.3.0-rc.3",
    "angular-translate": "2.4.0",
    "angular-cookies": "1.3.0-rc.3",
    "angular-translate-storage-cookie": "2.4.0",
    "angular-translate-storage-local": "2.4.0",
    "angular-ui-router": "0.2.11",
    "keydrown": "1.1.3",
    "lodash": "2.4.1",
    "angular-touch": "1.3.0-rc.3",
    "jquery-ui-touch-punch": "git://github.com/furf/jquery-ui-touch-punch.git",
    "angular-moment": "0.8.2",
    "jcrop": "0.9.12",
    "jquery-ui": "1.11.1",
    "bootstrap-sass": "twbs/bootstrap-sass#3.1.1",
    "select2": "3.5.1",
    "angular-ui-select2": "0.0.5",
    "angular-carousel": "0.2.5",
    "ng-file-upload": "1.6.6",
    "ocLazyLoad": "0.3.7",
    "modernizr": "2.8.3",
    "intro.js": "0.9.0",
    "ocModal": "0.1.7",
    "angular-localForage": "0.2.10",
    "skrollr": "0.6.26",
    "velocity": "1.1.0",
    "imagesloaded": "~3.1.8",
    "angular-material": "~0.0.3"
  },
  "resolutions": {
    "angular": "1.3.0-rc.3",
    "angular-translate": "2.4.0",
    "angular-translate-storage-cookie": "2.4.0",
    "select2": "3.5.1",
    "localforage": "0.9.2",
    "angular-touch": "1.3.0-rc.3",
    "moment": "2.8.3"
  },
  "overrides": {
    "jquery-ui-touch-punch": {
      "main": "jquery.ui.touch-punch.js",
      "dependencies": {
        "jquery-ui": "*"
      }
    },
    "modernizr": {
      "main": "modernizr.js"
    },
    "script.js": {
      "main": "dist/script.js"
    },
    "simptip": {
      "main": "simptip.scss"
    },
    "jcrop": {
      "main": "js/jquery.Jcrop.js"
    },
    "jquery-ui": {
      "main": [
        "ui/core.js",
        "ui/widget.js",
        "ui/mouse.js",
        "ui/draggable.js",
        "ui/droppable.js"
      ]
    },
    "skrollr": {
      "main": "dist/skrollr.min.js"
    },
    "angular": {
      "main": []
    },
    "select2": {
      "main": "select2.js"
    },
    "bootstrap-sass": {
      "main": [
        "vendor/assets/javascripts/bootstrap/transition.js",
        "vendor/assets/javascripts/bootstrap/tooltip.js",
        "vendor/assets/javascripts/bootstrap/popover.js",
        "vendor/assets/javascripts/bootstrap/collapse.js"
      ]
    },
    "intro.js": {
      "main": []
    },
    "jquery": {
      "main": []
    },
    "angular-carousel": {
      "main": "dist/angular-carousel.js"
    },
    "lodash": {
      "main": "dist/lodash.js"
    },
    "moment": {
      "main": [
        "moment.js",
        "locale/fr.js",
        "locale/es.js"
      ]
    },
    "ocLazyLoad": {
      "main": "dist/ocLazyLoad.js"
    },
    "ocModal": {
      "main": "dist/ocModal.js"
    },
    "angular-material": {
      "main": []
    }
  }
}

@es128
Copy link
Member

es128 commented Sep 26, 2014

Ok I was able to reproduce the problem (thanks for helping by providing your setup) and debug it. The issue is that config.files gets mutated by applying an alternate env, wiping out the original settings which the new filter was relying upon to suppress needless warnings. Fix (which is to copy default config settings into config.overrides._default) coming shortly.

@es128 es128 closed this as completed in 1a89c6b Sep 26, 2014
@ocombe
Copy link
Author

ocombe commented Sep 26, 2014

Cool, glad to know that it was and real bug and that you fixed it so fast, thanks !

@ocombe ocombe changed the title An option to disable warnings ? Warnings on conf override Sep 26, 2014
@ocombe ocombe changed the title Warnings on conf override Warnings on config override Sep 26, 2014
@ocombe
Copy link
Author

ocombe commented Sep 29, 2014

It works well with the new version, thanks !

@ujasur
Copy link

ujasur commented Feb 26, 2015

Hey, how can I suppress "xxxxx compiled, but not written. Check your javascript.joinTo config.

@es128
Copy link
Member

es128 commented Feb 26, 2015

Make your paths.watched match the same paths you actually intend to include in your build.

zenithtekla referenced this issue in zenithtekla/nodeMySQL Sep 30, 2016
- progressing on client side development, it becomes opinionated on the point to decide whether to continue with pug as main template and employ a build tool to render html files on load to integrate AngularJS better and SCSS to css.
- or revert the layout and other core views files to html with ejs
- The back-end code is pending migration to Angular2-Universal or Angular2-MeteorJS for better, agile, isomorphic, universal dev, ES6 import instead of require('module')..
- If MongoDB is used in the dev and prod,MEANJS stack or  Angular2-MeteorJS framework can be used right away without having to go through hoops of engineering this NodeMySQL app
- But as relational databases still prevail, NodeJS and MeteorJS dev requires some efforts wiring Sequelize and back-end RESTful coding to engineer the app
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants