How to load C3JS properly into WebPack?
Asked Answered
M

1

1

I am trying to use C3JS, which is a library based on D3JS in my VUEJS/WebPack project (created from this boilerplate).

I load D3JS by npm installing it and by loading it as a webpack plugin like anything else. However, doing the same for C3JS does not work.

plugins: [
    new webpack.ProvidePlugin({
      $: 'jquery', // <--- This works, I can call this variable anywhere in my JS code
      jQuery: 'jquery', // <--- This works...
      d3: 'd3', // <--- This works...
      c3: 'c3' // <--- This DOES NOT work, I can import c3 but the CSS is not loaded
    })
  ],

I tried to find some pattern but no luck...

For example D3JS has the following folder structure:

While C3JS has the following:

This is D3JS.

This is C3JS.

What am I missing?

Thanks!

Mancy answered 19/6, 2016 at 23:47 Comment(1)
Did you ever figure this out?Adrianeadrianna
L
0

Since webpack treats everything as a module you can also import 'path/to/c3/style.css. You can also use require syntax as well.

Lecherous answered 20/6, 2016 at 0:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.