Skip to content
New issue

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

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

Already on GitHub? # to your account

components loaded via split-require are absent after build #472

Closed
amsross opened this issue Apr 24, 2018 · 2 comments
Closed

components loaded via split-require are absent after build #472

amsross opened this issue Apr 24, 2018 · 2 comments

Comments

@amsross
Copy link

amsross commented Apr 24, 2018

this a 🐛 bug report

Expected Behavior

Running bankai start app.js should build the file(s) bundle-[#].js for the lazily loaded asset.
Running bankai build app.js should build the file(s) bundle-[#].js for the lazily loaded asset.

Current Behavior

The bundle-[#].js file(s) are accessible via HTTP requests after running bankai start app.js.
The bundle-[#].js file(s) are not present in dist after running bankai build app.js

There is no error.

Context

It's obviously possible this is more related to split-require than bankai, but the fact that bankai start app.js works while bankai build app.js does not makes me think otherwise.

Code Sample

I am able to reproduce this with my code as well as the sample code from https://github.com/goto-bus-stop/split-require#what

package.json

{
  "scripts": {
    "build": "bankai build app.js",
    "start": "bankai start app.js"
  },
  "dependencies": {
    "choo": "6.10.3"
  },
  "devDependencies": {
    "bankai": "9.11.1",
    "split-require": "3.1.0"
  }
}

app.js

var html = require('choo/html')
var app = require('choo')()
var splitRequire = require('split-require')

app.route('/', mainView)
app.mount('body')

var component
function mainView () {
  return html`<body>
    <h1>Loading</h1>
  </body>`
}

splitRequire('split-require', function (err, exports) {
  console.log(err, exports)
  app.emitter.emit('render')
})

Your Environment

Software Version(s)
Package bankai@9.11.1, split-require@3.1.0
Runtime node@8.9.4, node@6.14.1
Package Manager npm@5.8.0, npm@3.10.10
Operating System macOS 10.13.04
@amsross
Copy link
Author

amsross commented Apr 24, 2018

The following versions appear to work together:

➜ npm list split-require bankai
├─┬ bankai@9.1.0
│ └── split-require@2.0.3  deduped
└── split-require@2.0.3

goto-bus-stop added a commit that referenced this issue Apr 25, 2018
When #443 was merged, it moved the list of dynamic bundle names to a
metadata property on the `scripts:bundle` node. However, the `bankai
build` command was never updated to match.
@goto-bus-stop
Copy link
Member

📦 9.11.2 should fix this. thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants