question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JS files don't build in development mode

See original GitHub issue

I may be missing something here but I’m trying to get my JS to bundle on the yarn run blendid command. It builds fine when I run yarn run blendid -- build. I’m assuming this has something to do with the HMR, but b/c I’m using VM and browswersync in proxy mode I’m ok with the JS file reloading. It just does nothing currently.

Below is my task-config.js

module.exports = {
  html        : false,
  images      : true,
  fonts       : true,
  static      : true,
  svgSprite   : true,
  ghPages     : false,
  stylesheets : true,

  javascripts: {
    entry: {
      // files paths are relative to
      // javascripts.dest in path-config.json
      app: ["./app.js"]
    },
    publicPath: './public/javascripts'
  },

  browserSync: {
    proxy: 'outside.dev',
    files: ['./public/**/*'],
    watchOptions: {
      poll: true,
      aggregateTimeout: 300
    }
  },

  watch: {
    gulpWatch: {
      usePolling: true,
      interval: 1000,
      binaryInterval: 2500
    }
  },

  production: {
    rev: false
  }
}

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:6
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
hjbloklandcommented, Nov 10, 2017

When using browsersync at localhost:3000 Drupal will see the hot reloaded js file and auto reloads the page when you change something in the src/javascripts folder

0reactions
oletscommented, May 28, 2019

For the general “why am I not seeing processed JS files in my build directory” question, see https://github.com/vigetlabs/blendid/issues/494#issuecomment-343545781 (thanks @HJ-b!)

Without additional information, it sounds like the other problems were likely related to Browersync configuration or paths.

@nilsenpaul there isn’t currently a way to override the JS task. Feel free to open a new issue if that’s something you think would be useful and we can discuss

@guusvandewal glad you had success! Are you saying that ./profiles/PROFILENAME/ is necessary in the javascripts.publicPath? And was

provide: {
  $: "jquery",
  jQuery: "jquery"
},

necessary for Drupal 8? The rest of your configuration is as in https://github.com/vigetlabs/blendid/blob/master/extras/drupal/config/task-config.js. We may need to add or document the jquery requirement.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack / How to not bundle JS files in dev mode?
In dev mode, I would like to have access to each JS separately. I don't want them to be bundled in one file....
Read more >
How Does the Development Mode Work? - Overreacted
Let's take a look. The exact way to run different code in development depends on your JavaScript build pipeline (and whether you have...
Read more >
calling JS files in /static folder by script tag don't get fired on ...
Description. Calling a JS file with e.g. <script src="/static/folder/file.js" /> on gatsby develop doesn't call the file.
Read more >
Enabling and Disabling Angular Production Mode - Pluralsight
In this guide, we are going to learn about production mode. If you haven't heard this term before, don't worry—I'll walk you through...
Read more >
rollup.js
You can provide an optional Rollup configuration file to simplify command line usage and enable ... npm run build -- --environment BUILD:development.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found