choojs / bankai

:station: - friendly web compiler
Apache License 2.0
1.09k stars 102 forks source link

🐛Multiple external css files not built on build but ok on start #495

Closed yudao closed 6 years ago

yudao commented 6 years ago

🐛 bug report

Expected Behavior

All CSS local files compiled into bundle.css on build.

Current Behavior

Only the first css file is compiled on build. Even if I change the order. But it's ok when start is running.

Code Sample

var choo = require('choo')
var css = require('sheetify')

var MainView = require('./views/main')

css('tachyons') // <= COMPILED
css('./tachyons.extend.css')  // <= NOT COMPILED
css('./fonts.css')  // <= NOT COMPILED

const app = choo()
if (process.env.NODE_ENV !== 'production') {
  app.use(require('choo-devtools')())
  app.use(require('choo-service-worker/clear')())
}
app.use(require('choo-service-worker')())
app.route('/', MainView)
app.mount('body')

Your Environment

Software Version(s)
Package 9.12.1
Runtime node 8.9.4
Package Manager npm 6.1.0
Operating System Mac OSX High Sierra 10.13.4
ZhouHansen commented 6 years ago

Can't reproduce, try it: bankai-issue-495

yudao commented 6 years ago

Hi @ZhouHansen, thanks for your time.

I've repoduced the same behavior than my actual repo: https://github.com/ZhouHansen/bankai-issue-495/pull/1

When start is up, no problems. When build is made and I run it, header is not centered (classes from the tachyons.extend.css file) and no fonts are loaded (from fonts.css file).

Yu.

yudao commented 6 years ago

I've found the problem! I've let an @import directive in my tachyons.extend.css:

@import url(https://fonts.googleapis.com/css?family=Work+Sans:300,400,500,600,700&amp;lang=en);

It breaks the build.