Q:

Q: how to import a const to a string?

At the moment im building a application which requires a react-native webview because I wanted to build a offline charting application. There are at the moment of writing no librarys used for react-native to create a chart.
In order to create the chart I started to make a WebView because there are already librarys made based on D3.js  this webview got a template HTML inside.
So my train of thoughts: Create a webview add all the library's needed for the Graph's  and voila a nice graph in React-native.
The idea behind it works, but the Graph is a big blob on a component and trying to get it in another file. So I can include it with 1 line.

//import librarys for the html 'string'.
import d3 from './librarys/d3'
import c3 from './librarys/c3'
import styleSheet from './librarys/c3css'

These library's are concatenated to the Webview.
like this way:
 const HTML = `<html>
      <head>
        <title>Hello Static World</title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <meta name="viewport" content="width=320, user-scalable=no">
        <style type="text/css">
          body {
            margin: 0;
            padding: 0;
            font: 62.5% arial, sans-serif;
            background: #ccc;
          }
          h1 {
            padding: 45px;
            margin: 0;
            text-align: center;
            color: #33f;
          }

          `+ { styleSheet }+ `
        </style>`;

`
Result: all html but this part: + { styleSheet }+ `` still remains a [Object object] instead of the resulting string.
Is there anyway to include it properly? Instead of receiving Object object. Parsemethod?

A:

@Dan_abramov: "You can't "concatenate" imports. You need a bundler (like Browserify) that would bundle your JS. Then include it in HTML."
Source: https://twitter.com/dan_abramov/status/737283387128459264

