Giter VIP home page Giter VIP logo

webpack-isomorphic-tools's Introduction

webpack-isomorphic-tools

npm version npm downloads build status coverage

THIS PACKAGE IS DEPRECATED. LOOK ELSEWHERE.

webpack-isomorphic-tools is a small helper module providing very basic support for isomorphic (universal) rendering when using Webpack. It was created a long time ago when Webpack was v1 and the whole movement was just starting. Therefore webpack-isomorphic-tools is a hacky solution. It allowed many projects to set up basic isomorphic (universal) rendering in the early days but is now considered deprecated and new projects shouldn't use it. This library can still be found in legacy projects. For new projects use either universal-webpack or all-in-one frameworks like Next.js.

Topics

What it does

Suppose you have an application which is built using Webpack. It works in the web browser.

Should it be "isomorphic" ("universal")? It's better if it is. One reason is that search engines will be able to index your page. The other reason is that we live in a realtime mobile age which declared war on network latency, and so it's always better to fetch an already rendered content than to first fetch the application code and only then fetch the content to render the page. Every time you release a client-side only website to the internet someone writes a frustrated blog post.

So, it's obvious then that web applications should be "isomorphic" ("universal"), i.e. be able to render both on the client and the server, depending on circumstances. And it is perfectly possible nowadays since javascript runs everywhere: both in web browsers and on servers.

Ok, then one can just go ahead and run the web application in Node.js and its done. But, there's one gotcha: a Webpack application will usually crash when tried to be run in Node.js straight ahead (you'll get a lot of SyntaxErrors with Unexpected tokens).

The reason is that Webpack introduces its own layer above the standard javascript. This extra layer handles all require() calls magically resolving them to whatever it is configured to. For example, Webpack is perfectly fine with the code require()ing CSS styles or SVG images.

Bare Node.js doesn't come with such trickery up its sleeve. Maybe it can be somehow enhanced to be able to do such things? Turned out that it can, and that's what webpack-isomorphic-tools do: they inject that require() magic layer above the standard javascript in Node.js.

Still it's a hacky solution, and a better way would be to compile server-side code with Webpack the same way it already compiles the client-side code. This is achieved via target: "node" configuration option, and that's what universal-webpack library does. However, webpack-isomorphic-tools happened to be a bit simpler to set up, so they made their way into many now-legacy projects, so some people still use this library. It's not being maintained anymore though, and in case of any issues people should just migrate to universal-webpack or something similar.

webpack-isomorphic-tools mimics (to a certain extent) Webpack's require() magic when running application code on a Node.js server without Webpack. It basically fixes all those require()s of assets and makes them work instead of throwing SyntaxErrors. It doesn't provide all the capabilities of Webpack (for example, plugins won't work), but for the basic stuff, it works.

A simple example

For example, consider images. Images are require()d in React components and then used like this:

// alternatively one can use `import`, 
// but with `import`s hot reloading won't work
// import imagePath from '../image.png'

// Just `src` the image inside the `render()` method
class Photo extends React.Component
{
  render()
  {
    // When Webpack url-loader finds this `require()` call 
    // it will copy `image.png` to the build folder 
    // and name it something like `9059f094ddb49c2b0fa6a254a6ebf2ad.png`, 
    // because Webpack is set up to use the `[hash]` file naming feature
    // which makes browser asset caching work correctly.
    return <img src={ require('../image.png') }/>
  }
}

It works on the client-side because Webpack intelligently replaces all the require() calls with a bit of magic. But it wouldn't work on the server-side because Node.js only knows how to require() javascript modules. It would just throw a SyntaxError.

To solve this issue one can use webpack-isomorphic-tools. With the help of webpack-isomorphic-tools in this particular case the require() call will return the real path to the image on the disk. It would be something like ../../build/9059f094ddb49c2b0fa6a254a6ebf2ad.png. How did webpack-isomorphic-tools figure out this weird real file path? It's just a bit of magic.

webpack-isomorphic-tools is extensible, and finding the real paths for assets is the simplest example of what it can do inside require() calls. Using custom configuration one can make require() calls (on the server) return anything (not just a String; it may be a JSON object, for example).

For example, if one is using Webpack css-loader modules feature (also referred to as "local styles") one can make require(*.css) calls return JSON objects with generated CSS class names maps like they do in este and react-redux-universal-hot-example.

Installation

webpack-isomorphic-tools are required both for development and production

$ npm install webpack-isomorphic-tools --save

Usage

First you add webpack-isomorphic-tools plugin to your Webpack configuration.

webpack.config.js

var WebpackIsomorphicToolsPlugin = require('webpack-isomorphic-tools/plugin')

var webpackIsomorphicToolsPlugin = 
  // webpack-isomorphic-tools settings reside in a separate .js file 
  // (because they will be used in the web server code too).
  new WebpackIsomorphicToolsPlugin(require('./webpack-isomorphic-tools-configuration'))
  // also enter development mode since it's a development webpack configuration
  // (see below for explanation)
  .development()

// usual Webpack configuration
module.exports =
{
  context: '(required) your project path here',

  module:
  {
    loaders:
    [
      ...,
      {
        test: webpackIsomorphicToolsPlugin.regularExpression('images'),
        loader: 'url-loader?limit=10240', // any image below or equal to 10K will be converted to inline base64 instead
      }
    ]
  },

  plugins:
  [
    ...,

    webpackIsomorphicToolsPlugin
  ]

  ...
}

What does .development() method do? It enables development mode. In short, when in development mode, it disables asset caching (and enables asset hot reload), and optionally runs its own "dev server" utility (see port configuration setting). Call it in development webpack build configuration, and, conversely, don't call it in production webpack build configuration.

For each asset type managed by webpack-isomorphic-tools there should be a corresponding loader in your Webpack configuration. For this reason webpack-isomorphic-tools/plugin provides a .regularExpression(assetType) method. The assetType parameter is taken from your webpack-isomorphic-tools configuration:

webpack-isomorphic-tools-configuration.js

import WebpackIsomorphicToolsPlugin from 'webpack-isomorphic-tools/plugin'

export default
{
  assets:
  {
    images:
    {
      extensions: ['png', 'jpg', 'gif', 'ico', 'svg']
    }
  }
}

That's it for the client side. Next, the server side. You create your server side instance of webpack-isomorphic-tools in the very main server javascript file (and your web application code will reside in some server.js file which is require()d in the bottom)

main.js

var WebpackIsomorphicTools = require('webpack-isomorphic-tools')

// this must be equal to your Webpack configuration "context" parameter
var projectBasePath = require('path').resolve(__dirname, '..')

// this global variable will be used later in express middleware
global.webpackIsomorphicTools = new WebpackIsomorphicTools(require('./webpack-isomorphic-tools-configuration'))
// initializes a server-side instance of webpack-isomorphic-tools
// (the first parameter is the base path for your project
//  and is equal to the "context" parameter of you Webpack configuration)
// (if you prefer Promises over callbacks 
//  you can omit the callback parameter
//  and then it will return a Promise instead)
.server(projectBasePath, function()
{
  // webpack-isomorphic-tools is all set now.
  // here goes all your web application code:
  // (it must reside in a separate *.js file 
  //  in order for the whole thing to work)
  require('./server')
})

Then you, for example, create an express middleware to render your pages on the server

import React from 'react'

// html page markup
import Html from './html'

// will be used in express_application.use(...)
export function pageRenderingMiddleware(request, response)
{
  // clear require() cache if in development mode
  // (makes asset hot reloading work)
  if (process.env.NODE_ENV !== 'production')
  {
    webpackIsomorphicTools.refresh()
  }

  // for react-router example of determining current page by URL take a look at this:
  // https://github.com/catamphetamine/webapp/blob/master/code/server/webpage%20rendering.js
  const pageComponent = [determine your page component here using request.path]

  // for a Redux Flux store implementation you can see the same example:
  // https://github.com/catamphetamine/webapp/blob/master/code/server/webpage%20rendering.js
  const fluxStore = [initialize and populate your flux store depending on the page being shown]

  // render the page to string and send it to the browser as text/html
  response.send('<!doctype html>\n' +
        React.renderToString(<Html assets={webpackIsomorphicTools.assets()} component={pageComponent} store={fluxStore}/>))
}

And finally you use the assets inside the Html component's render() method

import React, {Component, PropTypes} from 'react'
import serialize from 'serialize-javascript'

export default class Html extends Component
{
  static propTypes =
  {
    assets    : PropTypes.object,
    component : PropTypes.object,
    store     : PropTypes.object
  }

  // a sidenote for "advanced" users:
  // (you may skip this)
  //
  // this file is usually not included in your Webpack build
  // because this React component is only needed for server side React rendering.
  //
  // so, if this React component is not `require()`d from anywhere in your client code,
  // then Webpack won't ever get here 
  // which means Webpack won't detect and parse any of the `require()` calls here,
  // which in turn means that if you `require()` any unique assets here 
  // you should also `require()` those assets somewhere in your client code,
  // otherwise those assets won't be present in your Webpack bundle and won't be found.
  //
  render()
  {
    const { assets, component, store } = this.props

    // "import" will work here too 
    // but if you want hot reloading to work while developing your project
    // then you need to use require()
    // because import will only be executed a single time 
    // (when the application launches)
    // you can refer to the "Require() vs import" section for more explanation
    const picture = require('../assets/images/cat.jpg')

    // favicon
    const icon = require('../assets/images/icon/32x32.png')

    const html = 
    (
      <html lang="en-us">
        <head>
          <meta charSet="utf-8"/>
          <title>xHamster</title>

          {/* favicon */}
          <link rel="shortcut icon" href={icon} />

          {/* styles (will be present only in production with webpack extract text plugin) */}
          {Object.keys(assets.styles).map((style, i) =>
            <link href={assets.styles[style]} key={i} media="screen, projection"
                  rel="stylesheet" type="text/css"/>)}

          {/* resolves the initial style flash (flicker) on page load in development mode */}
          { Object.keys(assets.styles).length === 0 ? <style dangerouslySetInnerHTML={{__html: require('../assets/styles/main_style.css')}}/> : null }
        </head>

        <body>
          {/* image requiring demonstration */}
          <img src={picture}/>

          {/* rendered React page */}
          <div id="content" dangerouslySetInnerHTML={{__html: React.renderToString(component)}}/>

          {/* Flux store data will be reloaded into the store on the client */}
          <script dangerouslySetInnerHTML={{__html: `window._flux_store_data=${serialize(store.getState())};`}} />

          {/* javascripts */}
          {/* (usually one for each "entry" in webpack configuration) */}
          {/* (for more informations on "entries" see https://github.com/petehunt/webpack-howto/) */}
          {Object.keys(assets.javascript).map((script, i) =>
            <script src={assets.javascript[script]} key={i}/>
          )}
        </body>
      </html>
    )

    return html
  }
}

assets in the code above are simply the contents of webpack-assets.json which is created by webpack-isomorphic-tools in your project base folder. webpack-assets.json (in the simplest case) keeps track of the real paths to your assets, e.g.

{
  "javascript":
  {
    "main": "/assets/main-d8c29e9b2a4623f696e8.js"
  },

  "styles":
  {
    "main": "/assets/main-d8c29e9b2a4623f696e8.css"
  },

  "assets":
  {
    "./assets/images/cat.jpg": "http://localhost:3001/assets/9059f094ddb49c2b0fa6a254a6ebf2ad.jpg",
    
    "./assets/images/icon/32x32.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQffBhcWAg6gFw6bAAAB60lEQVRIx+3UTUjUQRzG8c+u/n2BDe3lIJtQSuYhsPTQG+TFYLulguStoA5dPHYogoKigoi8dIsOCd0iiC4JFYFQBAVZEUgklWVQqam4vu1uF111d1310qWe0/yemfnyzPyG4b8KllQl6jWqNuX3nFNun/0qjJpYGRB1TkyRWu0C76Q0uKhOkT1aDfqSP0uxTpetR1i9e2Iq3HVUCQKt7tuWP0GDmDOGkfJd3GEbhFwzg6T3alR5lg0Ip0fVPhhKV2+UqfNcMu28sjlXggVAXEQoXZVKmlC2aGXETH5Ary3q026zPg8dtGnOKXPIi/x3MCJwUtyUqBN2uarXTi1+Cql1yqibuTKElsCaHBFBn1v6sU67RoGkHl3GciVYDNiuWVSphDEJYaSkRBSbNqLHI7PZgML0qNIFrz3OwqZAuQ6BB8KqRL01nA3YbdCVRW3L1KxGTx1zQMI3p01nAkqN5NnOkBrXJZw1qlOlj5mAlTQuqluXcRGTSrOPsJJeajOQzphaOyDucy47vGrAMvqLgCLlS97HmgH17mgRzFWhbEAq43/M1EYF2p1XoVAgMW8vdKFfmx0+LbO9WJNut3W44Ze4r/MTC6cKHBczutDhJSrxwyWDAntt9cRANoCwqLKcgJApAyZXfV//mP4AWg969geZ6qgAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTUtMDYtMjNUMjI6MDI6MTQrMDI6MDBG88r0AAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE1LTA2LTIzVDIyOjAyOjE0KzAyOjAwN65ySAAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAASUVORK5CYII="
  }
}

And that's it, now you can require() your assets "isomorphically" (both on client and server).

A working example

webpack-isomorphic-tools are featured in react-redux-universal-hot-example. There it is used to require() images and CSS styles (in the form of CSS modules).

Also you may look at this sample project. There it is used to require() images and CSS styles (without using CSS modules feature).

Some source code guidance for the aforementioned project:

Configuration

Available configuration parameters:

{
  // debug mode.
  // when set to true, lets you see debugging messages in the console.
  //
  debug: true, // is false by default

  // (optional)
  // (recommended)
  //
  // when `port` is set, then this `port` is used
  // to run an HTTP server serving Webpack assets.
  // (`express` npm package must be installed in order for this to work)
  //
  // this way, in development mode, `webpack-assets.json` won't ever
  // be written to disk and instead will always reside in memory
  // and be served from memory (just as `webpack-dev-server` does).
  //
  // this `port` setting will take effect only in development mode.
  //
  // port: 8888, // is false by default

  // verbosity.
  //
  // when set to 'no webpack stats',
  // outputs no Webpack stats to the console in development mode.
  // this also means no Webpack errors or warnings will be output to the console.
  //
  // when set to 'webpack stats for each build',
  // outputs Webpack stats to the console 
  // in development mode on each incremental build.
  // (i guess no one is gonna ever use this setting)
  //
  // when not set (default), outputs Webpack stats to the console 
  // in development mode for the first build only.
  //
  // verbosity: ..., // is `undefined` by default

  // enables support for `require.context()` and `require.ensure()` functions.
  // is turned off by default 
  // to skip unnecessary code instrumentation
  // because not everyone uses it.
  //
  // patch_require: true, // is false by default

  // By default it creates 'webpack-assets.json' file at 
  // webpackConfiguration.context (which is your project folder).
  // You can change the assets file path as you wish
  // (therefore changing both folder and filename).
  //
  // (relative to webpackConfiguration.context which is your project folder)
  //
  webpack_assets_file_path: 'webpack-assets.json',

  // By default, when running in debug mode, it creates 'webpack-stats.json' file at 
  // webpack_configuration.context (which is your project folder).
  // You can change the stats file path as you wish
  // (therefore changing both folder and filename).
  //
  // (relative to webpack_configuration.context which is your project folder)
  //
  webpack_stats_file_path: 'webpack-stats.json',

  // Makes `webpack-isomorphic-tools` aware of Webpack aliasing feature
  // (if you use it)
  // https://webpack.github.io/docs/resolving.html#aliasing
  //
  // The `alias` parameter corresponds to `resolve.alias` 
  // in your Webpack configuration.
  //
  alias: webpackConfiguration.resolve.alias, // is {} by default

  // if you're using Webpack's `resolve.modulesDirectories`
  // then you should also put them here.
  //
  // modulesDirectories: webpackConfiguration.resolve.modulesDirectories // is ['node_modules'] by default

  // here you can define all your asset types
  //
  assets:
  {
    // keys of this object will appear in:
    //  * webpack-assets.json
    //  * .assets() method call result
    //  * .regularExpression(key) method call
    //
    pngImages: 
    {
      // which file types belong to this asset type
      //
      extension: 'png', // or extensions: ['png', 'jpg', ...],

      // [optional]
      // 
      // here you are able to add some file paths 
      // for which the require() call will bypass webpack-isomorphic-tools
      // (relative to the project base folder, e.g. ./sources/server/kitten.jpg.js)
      // (also supports regular expressions, e.g. /^\.\/node_modules\/*/, 
      //  and functions(path) { return true / false })
      //
      // exclude: [],

      // [optional]
      // 
      // here you can specify manually the paths 
      // for which the require() call will be processed by webpack-isomorphic-tools
      // (relative to the project base folder, e.g. ./sources/server/kitten.jpg.js)
      // (also supports regular expressions, e.g. /^\.\/node_modules\/*/, 
      //  and functions(path) { return true / false }).
      // in case of `include` only included paths will be processed by webpack-isomorphic-tools.
      //
      // include: [],

      // [optional]
      // 
      // determines which webpack stats modules 
      // belong to this asset type
      //
      // arguments:
      //
      //  module             - a webpack stats module
      //
      //                       (to understand what a "module" is
      //                        read the "What's a "module"?" section of this readme)
      //
      //  regularExpression  - a regular expression 
      //                       composed of this asset type's extensions
      //                       e.g. /\.scss$/, /\.(ico|gif)$/
      //
      //  options            - various options
      //                       (development mode flag,
      //                        debug mode flag,
      //                        assets base url,
      //                        project base folder,
      //                        regular_expressions{} for each asset type (by name),
      //                        webpack stats json object)
      //
      //  log
      // 
      // returns: a Boolean
      //
      // by default is: "return regularExpression.test(module.name)"
      //
      // premade utility filters:
      //
      // WebpackIsomorphicToolsPlugin.styleLoaderFilter
      //  (for use with style-loader + css-loader)
      //
      filter: function(module, regularExpression, options, log)
      {
        return regularExpression.test(module.name)
      },

      // [optional]
      //
      // transforms a webpack stats module name 
      // to an asset path (usually is the same thing)
      //
      // arguments:
      //
      //  module  - a webpack stats module
      //
      //            (to understand what a "module" is
      //             read the "What's a "module"?" section of this readme)
      //
      //  options - various options
      //            (development mode flag,
      //             debug mode flag,
      //             assets base url,
      //             project base folder,
      //             regular_expressions{} for each asset type (by name),
      //             webpack stats json object)
      //
      //  log
      // 
      // returns: a String
      //
      // by default is: "return module.name"
      //
      // premade utility path extractors:
      //
      // WebpackIsomorphicToolsPlugin.styleLoaderPathExtractor
      //  (for use with style-loader + css-loader)
      //
      path: function(module, options, log)
      {
        return module.name
      },

      // [optional]
      // 
      // parses a webpack stats module object
      // for an asset of this asset type
      // to whatever you need to get 
      // when you require() these assets 
      // in your code later on.
      //
      // this is what you'll see as the asset value in webpack-assets.json: 
      // { ..., path(): compile(parser()), ... }
      //
      // can be a CommonJS module source code:
      // module.exports = ...what you export here is 
      //                     what you get when you require() this asset...
      //
      // if the returned value is not a CommonJS module source code
      // (it may be a string, a JSON object, whatever) 
      // then it will be transformed into a CommonJS module source code.
      //
      // in other words: 
      //
      // // making of webpack-assets.json
      // for each type of configuration.assets
      //   modules.filter(type.filter).for_each (module)
      //     assets[type.path()] = compile(type.parser(module))
      //
      // // requiring assets in your code
      // require(path) = (path) => return assets[path]
      //
      // arguments:
      //
      //  module  - a webpack stats module
      //
      //            (to understand what a "module" is
      //             read the "What's a "module"?" section of this readme)
      //
      //  options - various options
      //            (development mode flag,
      //             debug mode flag,
      //             assets base url,
      //             project base folder,
      //             regular_expressions{} for each asset type (by name),
      //             webpack stats json object)
      //
      //  log
      // 
      // returns: whatever (could be a filename, could be a JSON object, etc)
      //
      // by default is: "return module.source"
      //
      // premade utility parsers:
      //
      // WebpackIsomorphicToolsPlugin.urlLoaderParser
      //  (for use with url-loader or file-loader)
      //  require() will return file URL
      //  (is equal to the default parser, i.e. no parser)
      //
      // WebpackIsomorphicToolsPlugin.cssLoaderParser
      //  (for use with css-loader when not using "modules" feature)
      //  require() will return CSS style text
      //
      // WebpackIsomorphicToolsPlugin.cssModulesLoaderParser
      //  (for use with css-loader when using "modules" feature)
      //  require() will return a JSON object map of style class names
      //  which will also have a `_style` key containing CSS style text
      //
      parser: function(module, options, log)
      {
        log.info('# module name', module.name)
        log.info('# module source', module.source)
        log.info('# debug mode', options.debug)
        log.info('# development mode', options.development)
        log.info('# webpack version', options.webpackVersion)
        log.debug('debugging')
        log.warning('warning')
        log.error('error')
      }
    },
    ...
  },
  ...]
}

Configuration examples

url-loader / file-loader (images, fonts, etc)

url-loader and file-loader are supported with no additional configuration

{
  assets:
  {
    images:
    {
      extensions: ['png', 'jpg']
    },

    fonts:
    {
      extensions: ['woff', 'ttf']
    }
  }
}

style-loader (standard CSS stylesheets)

If you aren't using "CSS modules" feature of Webpack, and if in your production Webpack config you use ExtractTextPlugin for CSS styles, then you can set it up like this

{
  assets:
  {
    styles:
    {
      extensions: ['less', 'scss'],

      // which `module`s to parse CSS from:
      filter: function(module, regularExpression, options, log)
      {
        if (options.development)
        {
          // In development mode there's Webpack "style-loader",
          // which outputs `module`s with `module.name == asset_path`,
          // but those `module`s do not contain CSS text.
          //
          // The `module`s containing CSS text are 
          // the ones loaded with Webpack "css-loader".
          // (which have kinda weird `module.name`)
          //
          // Therefore using a non-default `filter` function here.
          //
          return WebpackIsomorphicToolsPlugin.styleLoaderFilter(module, regularExpression, options, log)
        }

        // In production mode there will be no CSS text at all
        // because all styles will be extracted by Webpack Extract Text Plugin
        // into a .css file (as per Webpack configuration).
        //
        // Therefore in production mode `filter` function always returns non-`true`.
      },

      // How to correctly transform kinda weird `module.name`
      // of the `module` created by Webpack "css-loader" 
      // into the correct asset path:
      path: WebpackIsomorphicToolsPlugin.styleLoaderPathExtractor,

      // How to extract these Webpack `module`s' javascript `source` code.
      // basically takes `module.source` and modifies `module.exports` a little.
      parser: WebpackIsomorphicToolsPlugin.cssLoaderParser
    }
  }
}

style-loader (CSS stylesheets with "CSS modules" feature)

If you are using "CSS modules" feature of Webpack, and if in your production Webpack config you use ExtractTextPlugin for CSS styles, then you can set it up like this

{
  assets:
  {
    styleModules:
    {
      extensions: ['less', 'scss'],

      // which `module`s to parse CSS style class name maps from:
      filter: function(module, regex, options, log)
      {
        if (options.development)
        {
          // In development mode there's Webpack "style-loader",
          // which outputs `module`s with `module.name == asset_path`,
          // but those `module`s do not contain CSS text.
          //
          // The `module`s containing CSS text are 
          // the ones loaded with Webpack "css-loader".
          // (which have kinda weird `module.name`)
          //
          // Therefore using a non-default `filter` function here.
          //
          return WebpackIsomorphicToolsPlugin.styleLoaderFilter(module, regex, options, log)
        }

        // In production mode there's no Webpack "style-loader",
        // so `module.name`s of the `module`s created by Webpack "css-loader"
        // (those which contain CSS text)
        // will be simply equal to the correct asset path
        return regex.test(module.name)
      },

      // How to correctly transform `module.name`s
      // into correct asset paths
      path: function(module, options, log)
      {
        if (options.development)
        {
          // In development mode there's Webpack "style-loader",
          // so `module.name`s of the `module`s created by Webpack "css-loader"
          // (those picked by the `filter` function above)
          // will be kinda weird, and this path extractor extracts 
          // the correct asset paths from these kinda weird `module.name`s
          return WebpackIsomorphicToolsPlugin.styleLoaderPathExtractor(module, options, log);
        }

        // in production mode there's no Webpack "style-loader",
        // so `module.name`s will be equal to correct asset paths
        return module.name
      },

      // How to extract these Webpack `module`s' javascript `source` code.
      // Basically takes `module.source` and modifies its `module.exports` a little.
      parser: function(module, options, log)
      {
        if (options.development)
        {
          // In development mode it adds an extra `_style` entry
          // to the CSS style class name map, containing the CSS text
          return WebpackIsomorphicToolsPlugin.cssModulesLoaderParser(module, options, log);
        }

        // In production mode there's Webpack Extract Text Plugin 
        // which extracts all CSS text away, so there's
        // only CSS style class name map left.
        return module.source
      }
    }
  }
}

svg-react-loader (CSS stylesheets with "CSS modules" feature)

{
  assets: {
    svg: {
      extension: 'svg',
      runtime: true
    }
  }
}
{
  module: {
    rules: [{
      test: /\.svg$/,
      use: [{
        loader: 'babel-loader'
      }, {
        loader: 'svg-react-loader'
      }]
    }]
  }
}

What are webpack-assets.json?

This file is needed for webpack-isomorphic-tools operation on server. It is created by a custom Webpack plugin and is then read from the filesystem by webpack-isomorphic-tools server instance. When you require(pathToAnAsset) an asset on server then what you get is simply what's there in this file corresponding to this pathToAnAsset key (under the assets section).

Pseudocode:

// requiring assets in your code
require(path) = (path) => return assets[path]

Therefore, if you get such a message in the console:

[webpack-isomorphic-tools] [error] asset not found: ./~/react-toolbox/lib/font_icon/style.scss

Then it means that the asset you requested (require()d) is absent from your webpack-assets.json which in turn means that you haven't placed this asset to your webpack-assets.json in the first place. How to place an asset into webpack-assets.json?

Pseudocode:

// making of webpack-assets.json inside the Webpack plugin
for each type of configuration.assets
  modules.filter(type.filter).for_each (module)
    assets[type.path()] = compile(type.parser(module))

Therefore, if you get the "asset not found" error, first check your webpack-assets.json and second check your webpack-isomorphic-tools configuration section for this asset type: are your filter, path and parser functions correct?

What are Webpack stats?

Webpack stats are a description of all the modules in a Webpack build. When running in debug mode Webpack stats are output to a file named webpack-stats.json in the same folder as your webpack-assets.json file. One may be interested in the contents of this file when writing custom filter, path or parser functions. This file is not needed for operation, it's just some debugging information.

What's a "module"?

This is an advanced topic on Webpack internals

A "module" is a Webpack entity. One of the main features of Webpack is code splitting. When Webpack builds your code it splits it into "chunks" - large portions of code which can be downloaded separately later on (if needed) therefore reducing the initial page load time for your website visitor. These big "chunks" aren't monolithic and in their turn are composed of "modules" which are: standard CommonJS javascript modules you require() every day, pictures, stylesheets, etc. Every time you require() something (it could be anything: an npm module, a javascript file, or a css style, or an image) a module entry is created by Webpack. And the file where this require() call originated is called a reason for this require()d module. Each module entry has a name and a source code, along with a list of chunks it's in and a bunch of other miscellaneous irrelevant properties.

For example, here's a piece of an example webpack-stats.json file (which is generated along with webpack-assets.json in debug mode). Here you can see a random module entry created by Webpack.

{
  ...

  "modules": [
    {
      "id": 0,
      ...
    },
    {
      "id": 1,
      "name": "./~/fbjs/lib/invariant.js",
      "source": "module.exports = global[\"undefined\"] = require(\"-!G:\\\\work\\\\isomorphic-demo\\\\node_modules\\\\fbjs\\\\lib\\\\invariant.js\");",

      // the rest of the fields are irrelevant

      "chunks": [
        0
      ],
      "identifier": "G:\\work\\isomorphic-demo\\node_modules\\expose-loader\\index.js?undefined!G:\\work\\isomorphic-demo\\node_modules\\fbjs\\lib\\invariant.js",
      "index": 27,
      "index2": 7,
      "size": 117,
      "cacheable": true,
      "built": true,
      "optional": false,
      "prefetched": false,
      "assets": [],
      "issuer": "G:\\work\\isomorphic-demo\\node_modules\\react\\lib\\ReactInstanceHandles.js",
      "failed": false,
      "errors": 0,
      "warnings": 0,

      "reasons": [
        {
          "moduleId": 418,
          "moduleIdentifier": "G:\\work\\isomorphic-demo\\node_modules\\react\\lib\\ReactInstanceHandles.js",
          "module": "./~/react/lib/ReactInstanceHandles.js",
          "moduleName": "./~/react/lib/ReactInstanceHandles.js",
          "type": "cjs require",
          "userRequest": "fbjs/lib/invariant",
          "loc": "17:16-45"
        },
        ...
        {
          "moduleId": 483,
          "moduleIdentifier": "G:\\work\\isomorphic-demo\\node_modules\\react\\lib\\traverseAllChildren.js",
          "module": "./~/react/lib/traverseAllChildren.js",
          "moduleName": "./~/react/lib/traverseAllChildren.js",
          "type": "cjs require",
          "userRequest": "fbjs/lib/invariant",
          "loc": "19:16-45"
        }
      ]
    },

    ...
  ]
}

Judging by its reasons and their userRequests one can deduce that this module is require()d by many other modules in this project and the code triggering this module entry creation could look something like this

var invariant = require('fbjs/lib/invariant')

Every time you require() anything in your code, Webpack detects it during build process and the require()d module is "loaded" (decorated, transformed, replaced, etc) by a corresponding module "loader" (or loaders) specified in Webpack configuration file (webpack.conf.js) under the "module.loaders" path. For example, say, all JPG images in a project are configured to be loaded with a "url-loader":

// Webpack configuration
module.exports =
{
  ...

  module:
  {
    loaders:
    [
      ...

      {
        test   : /\.jpg$/,
        loader : 'url-loader'
      }
    ]
  },

  ...
}

This works on client: require() calls will return URLs for JPG images. The next step is to make require() calls to these JPG images behave the same way when this code is run on the server, with the help of webpack-isomorphic-tools. So, the fields of interest of the module object would be name and source: first you find the modules of interest by their names (in this case, the module names would end in ".jpg") and then you parse the sources of those modules to extract the information you need (in this case that would be the real path to an image).

The module object for an image would look like this

{
  ...
  "name": "./assets/images/husky.jpg",
  "source": "module.exports = __webpack_public_path__ + \"9059f094ddb49c2b0fa6a254a6ebf2ad.jpg\""
}

Therefore, in this simple case, in webpack-isomorphic-tools configuration file we create an "images" asset type with extension "jpg" and these parameters:

  • the filter function would be module => module.name.endsWith('.jpg') (and it's the default filter if no filter is specified)
  • the path parser function would be module => module.name (and it's the default path parser if no path parser is specified)
  • the parser function would be module => module.source (and it's the default parser if no parser is specified)

When the javascript source code returned by this parser function gets compiled by webpack-isomorphic-tools it will yield a valid CommonJS javascript module which will return the URL for this image, resulting in the following piece of webpack-assets.json:

{
  ...
  assets:
  {
     "./assets/images/husky.jpg": "/assets/9059f094ddb49c2b0fa6a254a6ebf2ad.jpg",
     ...
  }
}

And so when you later require("./assets/images/husky.jpg") in your server code it will return "/assets/9059f094ddb49c2b0fa6a254a6ebf2ad.jpg" and that's it.

API

Note : All exported functions and public methods have camelCase aliases

Constructor

(both Webpack plugin and server tools)

Takes an object with options (see Configuration section above)

process.env.NODE_ENV

(server tools instance only)

process.env.NODE_ENV variable is examined to determine if it's production mode or development mode. Any value for process.env.NODE_ENV other than production will indicate development mode.

For example, in development mode, assets aren't cached, and therefore support hot reloading (if anyone would ever need that). Also development variable is passed to asset type's filter, path and parser functions.

The prevously available .development() method for the server-side instance is now deprecated and has no effect.

.development(true or false, or undefined -> true)

(Webpack plugin instance only)

Is it development mode or is it production mode? By default it's production mode. But if you're instantiating webpack-isomorphic-tools/plugin for use in Webpack development configuration, then you should call this method to enable asset hot reloading (and disable asset caching), and optinally to run its own "dev server" utility (see port configuration setting). It should be called right after the constructor.

.regularExpression(assetType)

(aka .regexp(pathToAnAsset))

(Webpack plugin instance)

Returns the regular expression for this asset type (based on this asset type's extension (or extensions))

WebpackIsomorphicToolsPlugin.urlLoaderParser

(Webpack plugin)

A parser (see Configuration section above) for Webpack url-loader, also works for Webpack file-loader. Use it for your images, fonts, etc.

.server(projectPath, [callback])

(server tools instance)

Initializes a server-side instance of webpack-isomorphic-tools with the base path for your project and makes all the server-side require() calls work. The projectPath parameter must be identical to the context parameter of your Webpack configuration and is needed to locate webpack-assets.json (contains the assets info) which is output by Webpack process.

When you're running your project in development mode for the very first time the webpack-assets.json file doesn't exist yet because in development mode webpack-dev-server and your application server are run concurrently and by the time the application server starts the webpack-assets.json file hasn't yet been generated by Webpack and require() calls for your assets would return undefined.

To fix this you can put your application server code into a callback and pass it as a second parameter and it will be called as soon as webpack-assets.json file is detected. If not given a callback this method will return a Promise which is fulfilled as soon as webpack-assets.json file is detected (in case you prefer Promises over callbacks). When choosing a Promise way you won't be able to get the webpack-isomorphic-tools instance variable reference out of the .server() method call result, so your code can be a bit more verbose in this case.

.refresh()

(server tools instance)

Refreshes your assets info (re-reads webpack-assets.json from disk) and also flushes cache for all the previously require()d assets

.assets()

(server tools instance)

Returns the contents of webpack-assets.json which is created by webpack-isomorphic-tools in your project base folder

Troubleshooting

Cannot find module

If encountered when run on server, this error means that the require()d path doesn't exist in the filesystem (all the require()d assets must exist in the filesystem when run on server). If encountered during Webpack build, this error means that the require()d path is absent from webpack-stats.json.

As an illustration, consider an example where a developer transpiles all his ES6 code using Babel into a single compiled file ./build/server-bundle-es5.js. Because all the assets still remain in the ./src directory, Cannot find module error will be thrown when trying to run the compiled bundle. As a workaround use babel-register instead. Or copy all assets to the ./build folder (keeping the file tree structure) and point Webpack context to the ./src folder.

SyntaxError: Unexpected token ILLEGAL

This probably means that in some asset module source there's a require() call to some file extension that isn't specified in

"TypeError: require.context is not a function" or "TypeError: require.ensure is not a function"

You should enable patch_require: true flag in your webpack-isomorphic-tools configuration file. The reason is that the support for require.context() and require.ensure() is hacky at the moment. It works and does its thing but the solution is not elegant enough if you know what I mean.

Infinite "(waiting for the first Webpack build to finish)"

If you're getting this message infinitely then it means that webpack-assets.json is never generated by Webpack.

It can happen, for example, in any of these cases

  • you forgot to add webpack-isomorphic-tools plugin to your Webpack configuration
  • you aren't running your Webpack build either in parallel with your app or prior to running you app
  • you're using webpack-dev-middleware inside your main server code which you shouldn't
  • your Webpack configuration's context path doesn't point to the project base directory

If none of those is your case, enable debug: true flag in webpack-isomorphic-tools configuration to get debugging info.

Miscellaneous

Webpack 2 System.import

Instead of implementing System.import in this library I think that it would be more rational to use existing tools for transforming System.import() calls into require() calls. See this stackoverflow answer for a list of such tools.

.gitignore

Make sure you add this to your .gitignore so that you don't commit these unnecessary files to your repo

# webpack-isomorphic-tools
/webpack-stats.json
/webpack-assets.json

Require() vs import

In the image requiring examples above we could have wrote it like this:

import picture from './cat.jpg'

That would surely work. Much simpler and more modern. But, the disadvantage of the new ES6 module importing is that by design it's static as opposed to dynamic nature of require(). Such a design decision was done on purpose and it's surely the right one:

  • it's static so it can be optimized by the compiler and you don't need to know which module depends on which and manually reorder them in the right order because the compiler does it for you
  • it's smart enough to resolve cyclic dependencies
  • it can load modules both synchronously and asynchronously if it wants to and you'll never know because it can do it all by itself behind the scenes without your supervision
  • the exports are static which means that your IDE can know exactly what each module is gonna export without compiling the code (and therefore it can autocomplete names, detect syntax errors, check types, etc); the compiler too has some benefits such as improved lookup speed and syntax and type checking
  • it's simple, it's transparent, it's sane

If you wrote your code with just imports it would work fine. But imagine you're developing your website, so you're changing files constantly, and you would like it all refresh automagically when you reload your webpage (in development mode). webpack-isomorphic-tools gives you that. Remember this code in the express middleware example above?

if (process.env.NODE_ENV !== 'production')
{
  webpackIsomorphicTools.refresh()
}

It does exactly as it says: it refreshes everything on page reload when you're in development mode. And to leverage this feature you need to use dynamic module loading as opposed to static one through imports. This can be done by require()ing your assets, and not at the top of the file where all require()s usually go but, say, inside the render() method for React components.

I also read on the internets that ES6 supports dynamic module loading too and it looks something like this:

System.import('module')
.then((module) =>
{
  // Use `module`
})
.catch(error =>
{
  ...
})

I'm currently unfamiliar with ES6 dynamic module loading system because I didn't research this question. Anyway it's still a draft specification so I guess good old require() is just fine to the time being.

Also it's good to know that the way all this require('./asset.whatever_extension') magic is based on Node.js require hooks and it works with imports only when your ES6 code is transpiled by Babel which simply replaces all the imports with require()s. For now, everyone out there uses Babel, both on client and server. But when the time comes for ES6 to be widely natively adopted, and when a good enough ES6 module loading specification is released, then I (or someone else) will port this "require hook" to ES6 to work with imports.

References

Initially based on the code from react-redux-universal-hot-example by Erik Rasmussen

Also the same codebase (as in the project mentioned above) can be found in isomorphic500 by Giampaolo Bellavite

Also uses require() hooking techniques from node-hook by Gleb Bahmutov

Contributing

After cloning this repo, ensure dependencies are installed by running:

npm install

This module is written in ES6 and uses Babel for ES5 transpilation. Widely consumable JavaScript can be produced by running:

npm run build

Once npm run build has run, you may import or require() directly from node.

After developing, the full test suite can be evaluated by running:

npm test

When you're ready to test your new functionality on a real project, you can run

npm pack

It will build, test and then create a .tgz archive which you can then install in your project folder

npm install [module name with version].tar.gz

To do

  • Implement require.context(folder, include_subdirectories, regular_expression) and require.ensure Webpack helper functions properly
  • Proper testing for log (output to a variable rather than console)
  • Proper testing for notify_stats (output to a log variable)
  • Proper testing for parsers (using eval() CommonJS module compilation)
  • Proper testing for require('./node_modules/whatever.jpg') test case

License

MIT

webpack-isomorphic-tools's People

Contributors

bartekus avatar catamphetamine avatar chrisblossom avatar fengmk2 avatar jason-cooke avatar jetpacmonkey avatar pmdroid avatar purecatamphetamine avatar vankhoawin avatar willdurand avatar wmyers avatar xdissent avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webpack-isomorphic-tools's Issues

"asset not found" Error while file is present in webpack-assets.json

Hi,

I came across this issue and I am not sure if it's due to the unusual folder structure of my project or if it's a bug from webpack-isomorphic-tools.

The issue can be reproduced on https://github.com/happypoulp/webpack-isomorphic/tree/issue-production

After running npm run webpack if you run npm start to start the application server, you'll see errors being emitted by webpack-isomorphic tools about some assets not being found.

Here is the debug output:

.local ~/Codes/webpack-iso > npm start

> [email protected] start /Users/fbonnefont/Codes/webpack-iso
> NODE_ENV=dev node app/bin/server.js

[webpack-isomorphic-tools] [debug] instantiated webpack-isomorphic-tools with options {
  "debug": true,
  "assets": {
    "json": {
      "extensions": [
        "json"
      ]
    },
    "scss": {
      "extensions": [
        "scss"
      ]
    }
  },
  "webpack_assets_file_path": "webpack-assets.json",
  "webpack_stats_file_path": "webpack-stats.json"
}
[webpack-isomorphic-tools] [debug] entering development mode
[webpack-isomorphic-tools] [debug] registering require() hooks for assets
[webpack-isomorphic-tools] [debug]  registering a require() hook for *.json
[require-hook] [debug] Hooking into *.json files loading
[require-hook] [debug] -----------------------------------------------
[require-hook] [debug] Overriding an already existing require() hook
[require-hook] [debug] for file extension .json
[require-hook] [debug] -----------------------------------------------
[webpack-isomorphic-tools] [debug]  registering a require() hook for *.scss
[require-hook] [debug] Hooking into *.scss files loading
FAKE SERVER
[webpack-isomorphic-tools] [debug] flushing require() caches
[require-hook] [debug] require() hook fired for /Users/fbonnefont/Codes/webpack-iso/app/src/base.scss
[webpack-isomorphic-tools] [debug] require() called for /Users/fbonnefont/Codes/webpack-iso/app/src/base.scss
[webpack-isomorphic-tools] [debug]  requiring ./src/base.scss
[require-hook] [debug] require() hook fired for /Users/fbonnefont/Codes/webpack-iso/app/webpack-assets.json
[require-hook] [debug] Fallback to original loader
[webpack-isomorphic-tools] [error] asset not found: ./src/base.scss
[require-hook] [debug] require() hook fired for /Users/fbonnefont/Codes/webpack-iso/app/src/mod-1.scss
[webpack-isomorphic-tools] [debug] require() called for /Users/fbonnefont/Codes/webpack-iso/app/src/mod-1.scss
[webpack-isomorphic-tools] [debug]  requiring ./src/mod-1.scss
[webpack-isomorphic-tools] [error] asset not found: ./src/mod-1.scss
[require-hook] [debug] require() hook fired for /Users/fbonnefont/Codes/webpack-iso/app/src/file.json
[webpack-isomorphic-tools] [debug] require() called for /Users/fbonnefont/Codes/webpack-iso/app/src/file.json
[webpack-isomorphic-tools] [debug]  requiring ./src/file.json
[webpack-isomorphic-tools] [error] asset not found: ./src/file.json
...

What puzzles me is that for example ./src/base.scss is actually present in webpack-assets.json but under the path ./app/src/base.scss... The project_base_path I gave to webpack-isomorphic-tools server is the same as the one used in my webpack.config.js as suggested in your docs but I think that the issue might come from that setup.

Do you know what the issue could come from?

Thanks!

Slow Performance on AWS Lambda

I'm rendering my React template on AWS lambda and just added npm debug module to see where the bottleneck is. Looks like it's when I require my react component that I am pre-compiling through Babel. I don't see this performance hit locally. I'm wondering if redefinition of require hooks in webpack-isomorphic-tools could be slowing down performance? There is a 20s lag in the logs below when the component is required as well as a 13s lag when initial function is require inside of the isomorphic tools Promise. I can try disabling ismorphic tools and see if it helps but wanted to ask if you have any ideas of the top of your head for performance hit?

tools entry

import path from 'path';
import {assign} from 'lodash';
import WebpackIsomorphicTools from 'webpack-isomorphic-tools';
import makeConfig from '../gulp/config';
import makeIsomporphicToolsConfig from '../gulp/tasks/webpack/webpack-isomorphic-tools';
import makeBootstrap from '../src/js/utils/bootstrap';
import reactor from '../src/js/modules/flux';

/**
 * Run the app with lambda or start the local dev server
 * @param {Object} data mock form data or data passed from lamda
 * @param {Boolean:undefined} isLocal true if module is run directly (ie. not required by lambda)
 * @param {Function} cb callback args => (err, html)
 * @return {undefined} use the cb
 */
export default function({data, isLocal}, cb) {
  const debug = require('./utils/run-debug')(__filename);
  const {NODE_ENV} = process.env;
  const config = makeConfig({ENV: NODE_ENV});
  const {environment, sources, utils} = config;
  const {isDev} = environment;
  const {buildDir, statsFile} = sources;
  const {logError} = utils;

  const toolsConfig = makeIsomporphicToolsConfig({statsFile: path.basename(statsFile)});
  const tools = new WebpackIsomorphicTools(toolsConfig);
  const bootstrap = makeBootstrap({
    reactor,
    data,
    env: 'server'
  });
  const statsDir = path.resolve(__dirname, '..', buildDir);

  debug('Running Isomporphic Tools');
  tools.development(isDev).server(statsDir).then(() => {
    debug('Running bootstrap#init');

    return bootstrap.init().then((props) => {
      const templatingArgs = {
        data: assign({}, data, props),
        tools,
        config: config,
        props
      };

      //do dynamic require because we don't need express to be copied for the lamda
      if (isLocal) {
        debug('Calling local server');
        const runServer = require('./dev-server');
        runServer(templatingArgs, cb);
      } else {
        debug('Calling lambda function');
        const runLambda = require('./lambda-function');
        runLambda(templatingArgs, cb);
      }
    }).catch((err) => {
      logError({err, plugin: '[app: bootstrap.inti]'});
    });
  });
}

debugging code

import async from 'async';
import glob from 'globby';
import ReactDOM from 'react-dom/server';
import React from 'react';

export default function(config) {
  const debug = require('../utils/run-debug')(__filename);
  const {utils} = config;
  const {addbase} = utils;

  function _transform(data) {
    return function(fp, cb) {
      debug('[assemble: transform] require snippet');
      fp = addbase(fp);
      const Snippet = require(fp);
      debug('[compiling: start] ReactDOM#renderToString');
      const contents = ReactDOM.renderToString(React.createElement(Snippet, data));
      debug('[compiling: end] ReactDOM#renderToString');
      cb(null, {path: fp, contents});
    };
  }

  return function(collection) {
    debug('[assemble: loader] Initializing JSX Collection');
    collection.load = function(patterns, options, data, cb) {
      options = options || {};
      const files = glob.sync(patterns, options);

      async.map(files, _transform(data), function(err, results) {
        if (err) {
          cb(err);
        } else {
          results.forEach(function(file) {
            collection.addView(file.path, file);
          });
          debug('[assemble: loader] Finished Compiling JSX Collection');
          cb();
        }
      });
    };
  };
}

Lambda output

DEBUG: Wed, 04 Nov 2015 00:09:17 GMT bin/runner.js LOADING bin/runner.js => BRANCH dfp/update-environmentalization 
DEBUG: Wed, 04 Nov 2015 00:09:17 GMT bin/runner.js [lambda: init] 
DEBUG: Wed, 04 Nov 2015 00:09:17 GMT app/index.js LOADING app/index.js => BRANCH dfp/update-environmentalization 
DEBUG: Wed, 04 Nov 2015 00:09:17 GMT app/index.js Running Isomporphic Tools 
DEBUG: Wed, 04 Nov 2015 00:09:17 GMT app/index.js Running bootstrap#init 
DEBUG: Wed, 04 Nov 2015 00:09:17 GMT app/index.js Calling lambda function 
DEBUG: Wed, 04 Nov 2015 00:09:30 GMT app/lambda-function.js LOADING app/lambda-function.js => BRANCH dfp/update-environmentalization 
DEBUG: Wed, 04 Nov 2015 00:09:30 GMT lib/template-assemble.js LOADING lib/template-assemble.js => BRANCH dfp/update-environmentalization 
DEBUG: Wed, 04 Nov 2015 00:09:37 GMT lib/jsx-loader.js LOADING lib/jsx-loader.js => BRANCH dfp/update-environmentalization 
DEBUG: Wed, 04 Nov 2015 00:09:37 GMT lib/jsx-loader.js [assemble: loader] Initializing JSX Collection 
DEBUG: Wed, 04 Nov 2015 00:09:37 GMT lib/template-assemble.js Calling tempalateAssemble#renderTemp 
DEBUG: Wed, 04 Nov 2015 00:09:37 GMT lib/jsx-loader.js [assemble: transform] require snippet 
DEBUG: Wed, 04 Nov 2015 00:09:57 GMT lib/jsx-loader.js [compiling: start] ReactDOM#renderToString 
DEBUG: Wed, 04 Nov 2015 00:10:00 GMT lib/jsx-loader.js [compiling: end] ReactDOM#renderToString 
DEBUG: Wed, 04 Nov 2015 00:10:00 GMT lib/jsx-loader.js [assemble: loader] Finished Compiling JSX Collection 
DEBUG: Wed, 04 Nov 2015 00:10:00 GMT lib/template-assemble.js [rendering: start] tempalateAssemble#renderTemp 
DEBUG: Wed, 04 Nov 2015 00:10:02 GMT lib/template-assemble.js [rendering: end] tempalateAssemble#renderTemp 
DEBUG: Wed, 04 Nov 2015 00:10:02 GMT bin/runner.js [lambda: upload-success] 
[lambda]: Success uploading lambda data 
DEBUG: Wed, 04 Nov 2015 00:10:02 GMT services/s3-uploader.js LOADING services/s3-uploader.js => BRANCH dfp/update-environmentalization 
DEBUG: Wed, 04 Nov 2015 00:10:02 GMT services/s3-uploader.js UPLOADING TO MASTER: false 
DEBUG: uploaded file
Duration: 46100 ms

SVGs are displayed as base64 strings

I'm using svg-inline loader for some svg icons. The component requires them inlined (as suggested by svg-inline loader). Using webpack-isomorphic-tools displays base64 strings inside those components.

Is there any way to fix / enhance this ?

Thank you so much !!!

Breaking random node modules

I always have random node modules breaking and cannot get request, superagent to work

Here is an example

Users/mmahalwy/Desktop/quran/quran.com-frontend/node_modules/keen-js/src/core/index.js:4
var previous_Keen = root.Keen;
                        ^
TypeError: Cannot read property 'Keen' of undefined
    at Object.<anonymous> (/Users/mmahalwy/Desktop/quran/quran.com-frontend/node_modules/keen-js/src/core/index.js:2:25)
    at Module._compile (module.js:460:26)
    at normalLoader (/Users/mmahalwy/Desktop/quran/quran.com-frontend/node_modules/babel-core/lib/api/register/node.js:199:5)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/mmahalwy/Desktop/quran/quran.com-frontend/node_modules/babel-core/lib/api/register/node.js:216:7)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/mmahalwy/Desktop/quran/quran.com-frontend/node_modules/keen-js/src/server/index.js:1:12)
    at Module._compile (module.js:460:26)

webpack-assets.json not found, can't figure out to actually create the files

I have this in my dev-config of webpack:

import webpack from 'webpack';
import _ from 'lodash';
import webpack_isomorphic_tools_plugin from 'webpack-isomorphic-tools/plugin';

const webpackIsomorphicToolsPlugin = new webpack_isomorphic_tools_plugin(
  require('./webpack-isomorphic-tools-configuration')
).development(true);

const regular_expressions = {
  images : /\.(png|jpg|gif|svg|ico)$/,
  fonts: /\.(woff|woff2|eot|ttf)$/,
  radars: /(.*\.)?radar.yml$/,
  javascript: /\.(js|jsx)$/,
  stylus: /\.styl/
};

const baseConfig = require('./base');
const config = _.merge({
  progress: true,
  debug: true,
  entry: [
    'eventsource-polyfill',
    'webpack-hot-middleware/client',
    './src/boot-client'
  ],
  module: {
    preLoaders: [{
      test: regular_expressions.stylus,
      loader: 'stylint'
    }],
    loaders: [{
      test: webpackIsomorphicToolsPlugin.regular_expression('css'),
      loader: 'style_loader!css'
    },{
      test: webpackIsomorphicToolsPlugin.regular_expression('styl'),
      loader: 'style-loader!css-loader!stylus-loader'
    },{
      test: webpackIsomorphicToolsPlugin.regular_expression('fonts'),
      loader: 'url-loader?limit=8192&name=[path][name].[ext]?[hash]'
    },{
      test: webpackIsomorphicToolsPlugin.regular_expression('images'),
      loader: 'url-loader?limit=8192&name=[path][name].[ext]?[hash]'
    },{
      test: webpackIsomorphicToolsPlugin.regular_expression('yml'),
      loader: 'radar-loader'
    }]
  },
  cache: true,
  devtool: 'eval',
  plugins: [
    new webpack.HotModuleReplacementPlugin(),
    new webpack.NoErrorsPlugin(),
    webpackIsomorphicToolsPlugin
  ]
}, baseConfig);

module.exports = config;

and this is the base config:

const path = require('path');
const fs = require('fs');
const autoprefixer = require('autoprefixer');
const poststylus = require('poststylus');

const port = 8000;
const srcPath = path.join(__dirname, '/../src');
const virtualPath = process.env.BEKKRADAR_VIRTUAL_PATH || '';
const publicPath = virtualPath + '/assets/';
const rootDir = path.join(__dirname, '..');

module.exports = {
  port: port,
  context: rootDir,
  debug: true,
  output: {
    path: path.resolve(rootDir, 'dist', 'assets'),
    filename: 'app.js',
    publicPath: publicPath
  },
  devServer: {
    contentBase: './src/',
    historyApiFallback: true,
    hot: true,
    port: port,
    publicPath: publicPath,
    noInfo: false
  },
  resolve: {
    extensions: ['', '.js', '.jsx','.styl', '.css'],
    alias: {
      actions: srcPath + '/actions/',
      components: srcPath + '/components/',
      containers: srcPath + '/containers/',
      content: srcPath + '/content/',
      store: srcPath + '/store/',
      styles: srcPath + '/styles/',
      config: srcPath + '/config/' + process.env.REACT_WEBPACK_ENV
    }
  },
  stylus: {
    use: [
      poststylus([
        autoprefixer({browsers: 'last 2 versions, > 1%'})
      ])
    ]
  },
  stylint: JSON.parse(fs.readFileSync(path.join(__dirname, '../.stylintrc'), 'utf-8'))
};

And this in the isomorphic tools config:

import webpack_isomorphic_tools_plugin from 'webpack-isomorphic-tools/plugin';
import path from 'path';

const srcPath = path.join(__dirname, '/../src');

module.exports = {
  debug: true,
  alias: {
    actions: srcPath + '/actions/',
    components: srcPath + '/components/',
    containers: srcPath + '/containers/',
    content: srcPath + '/content/',
    store: srcPath + '/store/',
    styles: srcPath + '/styles/',
    config: srcPath + '/config/' + process.env.REACT_WEBPACK_ENV
  },
  assets:
  {
    images: {
      extensions: ['png', 'jpg', 'gif', 'ico'],
      parser: webpack_isomorphic_tools_plugin.url_loader_parser
    },
    svg: {
      extension: 'svg',
      parser: webpack_isomorphic_tools_plugin.url_loader_parser
    },
    fonts: {
      extensions: ['woff', 'woff2', 'ttf', 'eot'],
      parser: webpack_isomorphic_tools_plugin.url_loader_parser
    },
    css: {
      extension: 'css',
      filter: function(module, regular_expression, options, log){
        if (options.development){
          return webpack_isomorphic_tools_plugin.style_loader_filter(module, regular_expression, options, log);
        }
      },
      path: webpack_isomorphic_tools_plugin.style_loader_path_extractor,
      parser: webpack_isomorphic_tools_plugin.css_loader_parser
    },
    styl: {
      extension: 'styl'
    },
    yml: {
      extension: 'yml'
    }
  }
};

And this is my dev server:

/*eslint no-console:0 */
const webpackIsomorphicTools = require('webpack-isomorphic-tools');
const express = require('express');
const webpack = require('webpack');
const path = require('path');
const rootDir = path.join(__dirname, '..');
const config = require('../webpack.config');
const compiler = webpack(config);

global.webpack_isomorphic_tools = new webpackIsomorphicTools(require('../cfg/webpack-isomorphic-tools-configuration'))
  .development(true)
  .server(rootDir,function(){
    const app = new express();

    // app.use('/assets', express.static(path.join(__dirname, '../dist/assets')));

    app.use(require('webpack-dev-middleware')(compiler, {
      noInfo: false,
      stats: {
        colors: true,
        chunks: false,
        timings: false,
        version: false
      },
      publicPath: config.output.publicPath
    }));

    app.use(require('webpack-hot-middleware')(compiler));

    app.use(require('../src/boot-server'));

    app.get('*', function(req, res) {
      res.status(404).send('Server.js > 404 - Page Not Found');
    });

    app.use((err, req, res) => {
      console.error('Error on request %s %s', req.method, req.url);
      console.error(err.stack);
      res.status(500).send('Server error');
    });

    process.on('uncaughtException', evt => {
      console.log( 'uncaughtException: ', evt );
    });

    app.listen(config.port, function(error) {
      if (error) {
        console.error(error);
      } else {
        console.info('----\n==> ๐Ÿ’ป  Open up http://localhost:%s/ in your browser.', config.port, config.port);
      }
    });
  }
);

And all I get outputed is the debug info and wait messages, no files produced (I've checked all dirs down and up)

> node -r babel-register servers/server.dev.js --env=dev

[webpack-isomorphic-tools/plugin] [debug] entering development mode
[webpack-isomorphic-tools] [debug] instantiated webpack-isomorphic-tools with options {
  "debug": true,
  "alias": {
    "actions": "/<dir>/src/actions/",
    "components": "/<dir>/src/components/",
    "containers": "/<dir>/src/containers/",
    "content": "/<dir>/src/content/",
    "store": "/<dir>/src/store/",
    "styles": "/<dir>/src/styles/",
    "config": "/<dir>/src/config/dev"
  },
  "assets": {
    "images": {
      "extensions": [
        "png",
        "jpg",
        "gif",
        "ico"
      ]
    },
    "svg": {
      "extensions": [
        "svg"
      ]
    },
    "fonts": {
      "extensions": [
        "woff",
        "woff2",
        "ttf",
        "eot"
      ]
    },
    "css": {
      "extensions": [
        "css"
      ]
    },
    "styl": {
      "extensions": [
        "styl"
      ]
    },
    "yml": {
      "extensions": [
        "yml"
      ]
    }
  },
  "webpack_assets_file_path": "webpack-assets.json",
  "webpack_stats_file_path": "webpack-stats.json"
}
[webpack-isomorphic-tools] [debug] entering development mode
[webpack-isomorphic-tools] [debug] registering require() hooks for assets
[webpack-isomorphic-tools] [debug]  registering a require() hook for *.png
[require-hook] [debug] Hooking into *.png files loading
[webpack-isomorphic-tools] [debug]  registering a require() hook for *.jpg
[require-hook] [debug] Hooking into *.jpg files loading
[webpack-isomorphic-tools] [debug]  registering a require() hook for *.gif
[require-hook] [debug] Hooking into *.gif files loading
[webpack-isomorphic-tools] [debug]  registering a require() hook for *.ico
[require-hook] [debug] Hooking into *.ico files loading
[webpack-isomorphic-tools] [debug]  registering a require() hook for *.svg
[require-hook] [debug] Hooking into *.svg files loading
[webpack-isomorphic-tools] [debug]  registering a require() hook for *.woff
[require-hook] [debug] Hooking into *.woff files loading
[webpack-isomorphic-tools] [debug]  registering a require() hook for *.woff2
[require-hook] [debug] Hooking into *.woff2 files loading
[webpack-isomorphic-tools] [debug]  registering a require() hook for *.ttf
[require-hook] [debug] Hooking into *.ttf files loading
[webpack-isomorphic-tools] [debug]  registering a require() hook for *.eot
[require-hook] [debug] Hooking into *.eot files loading
[webpack-isomorphic-tools] [debug]  registering a require() hook for *.css
[require-hook] [debug] Hooking into *.css files loading
[webpack-isomorphic-tools] [debug]  registering a require() hook for *.styl
[require-hook] [debug] Hooking into *.styl files loading
[webpack-isomorphic-tools] [debug]  registering a require() hook for *.yml
[require-hook] [debug] Hooking into *.yml files loading
[webpack-isomorphic-tools] [debug] (/<dir>/webpack-assets.json not found)
[webpack-isomorphic-tools] (waiting for the first Webpack build to finish)
[webpack-isomorphic-tools] [debug] (/<dir>/webpack-assets.json not found)
[webpack-isomorphic-tools] (waiting for the first Webpack build to finish)
[webpack-isomorphic-tools] [debug] (/<dir>/webpack-assets.json not found)
[webpack-isomorphic-tools] (waiting for the first Webpack build to finish)

What am I doing wrong here?

Error Since 2.2.0

Just compiled package on Travis and after update to 2.2.0 I'm getting an error. As mentioned in some of my previous issues I'm using one webpack task to just compile my SCSS through webpack and extract text plugin. I'm also importing/requiring images in this bundle in order to generate stats on their hashed file paths and public path that I can use in my html templating. I use the webpack-isomorpic-tools plugin with this bundle just to generate stats because it is more convenient that making my own stats plugin that I was using previously. Since 2.2.0 I'm getting an error I don't understand?

here is my tools config:

export default function({statsFile, isDev}) {
  return {
    debug: isDev,

    webpack_assets_file_path: statsFile,

    assets: {
      images: {
        extensions: [
          'jpeg',
          'jpg',
          'png',
          'gif'
        ],
        filter(m, regex, options, log) {
          return regex.test(m.name);
        },
        parser(m, options, log) {
          const {publicPath} = options.webpack_stats;
          const [fullName] = m.assets;

          return process.env.TRAVIS_BRANCH ? publicPath + path.sep + fullName : fullName;
        },
        naming(m, options, log) {
          const {name} = m;
          const base = path.basename(name, path.extname(name));
          return dashToCamel(base);
        }
      }
    }
  };
}

here are my loaders

  const loaders = [
    {
      test: /\.jsx?$/,
      exclude: shouldExclude,
      loader: jsxLoader,
      query: isMainTask ? babelrc : babelQuery
    },
    {
      test: toolsPlugin.regular_expression('images'),
      loader: fileLoader
    }
]

here is the webpack file importing sass and images

import '../scss/global.scss';

//require all the images
require.context('../img', true, /.(jpeg|jpg|png|gif)$/);

here is the terminal output

[13:45:06] Requiring external module babel-core/register
[13:45:08] Using gulpfile ~/dev/bdu/gulpfile.babel.js
[13:45:08] Starting 'build'...
[13:45:08] Starting 'clean'...
[13:45:08] Starting 'lint:test'...
[13:45:08] Starting 'lint:build'...
[13:45:08] Finished 'clean' after 277 ms
[13:45:09] Finished 'lint:test' after 711 ms
[13:45:10] Finished 'lint:build' after 1.81 s
[13:45:10] Starting 'lint'...
[13:45:10] Finished 'lint' after 5.57 ฮผs
[13:45:10] Starting 'webpack:global'...
[13:45:10] Webpack Bundling global bundle
[13:45:10] Starting 'webpack:main'...
[13:45:10] Webpack Bundling main bundle
[13:45:10] Starting 'env'...
[13:45:10] Finished 'env' after 13 ms
[13:45:20] Webpack Bundled main bundle in 10006ms
[13:45:20] Finished 'webpack:main' after 10 s
webpack built c62c63e5e6cb5390d837 in 10006ms
==> ๐Ÿšง  Webpack development server listening on port 8080
/Users/davidfox-powell/dev/bdu/src/src/img/donate-main.jpg.webpack-module:1
(function (exports, require, module, __filename, __dirname) { img/donate-main.jpg
                                                              ^

ReferenceError: img is not defined
    at Object.<anonymous> (/Users/davidfox-powell/dev/bdu/src/src/img/donate-main.jpg.webpack-module:1:63)
    at Module._compile (module.js:435:26)
    at Object._module3.default._extensions.(anonymous function) [as .webpack-module] (/Users/davidfox-powell/dev/bdu/node_modules/webpack-isomorphic-tools/node_modules/require-hacker/babel-transpiled-modules/require hacker.js:270:11)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at populate_assets (/Users/davidfox-powell/dev/bdu/node_modules/webpack-isomorphic-tools/babel-transpiled-modules/plugin/write assets.js:361:31)
    at Object.write_assets [as default] (/Users/davidfox-powell/dev/bdu/node_modules/webpack-isomorphic-tools/babel-transpiled-modules/plugin/write assets.js:64:2)
    at Compiler.<anonymous> (/Users/davidfox-powell/dev/bdu/node_modules/webpack-isomorphic-tools/babel-transpiled-modules/plugin/plugin.js:151:27)
    at Compiler.applyPlugins (/Users/davidfox-powell/dev/bdu/node_modules/webpack/node_modules/tapable/lib/Tapable.js:26:37)
    at Watching._done (/Users/davidfox-powell/dev/bdu/node_modules/webpack/lib/Compiler.js:78:17)
    at Watching.<anonymous> (/Users/davidfox-powell/dev/bdu/node_modules/webpack/lib/Compiler.js:61:18)
    at Compiler.emitRecords (/Users/davidfox-powell/dev/bdu/node_modules/webpack/lib/Compiler.js:282:37)
    at Watching.<anonymous> (/Users/davidfox-powell/dev/bdu/node_modules/webpack/lib/Compiler.js:58:19)
    at /Users/davidfox-powell/dev/bdu/node_modules/webpack/lib/Compiler.js:275:11

LESS asset renders in router components, but throws an `asset not found` error in Html component

Apologies if this is the wrong place to ask this question โ€” I haven't had much luck elsewhere!

I've got an app based on the Universal Hot Example, and am getting [error] asset not found when attempting to require() a LESS file.

I've copied the style-loader configuration from this repo, and confirmed that it's possible to render this file in components called by react-router. However, if I render the file from an Html container component (using the convention in your Html component here), the error is thrown.

I'm not sure if this is originating from Webpack Isomorphic Tools, or a configuration issue, or something else โ€”ย but it's got me stumped.

I've put together a quick example here that demonstrates what I'm seeing: https://github.com/jonlong/universal-webpack-troubleshooting

If you could point me in the right direction, I'd really appreciate it!

Questions of Babel Compilation

This is a question around use of webpack-isomorphic-tools and compilation through babel vs. use of the babel/register.

I have a script that runs similar to the original demo I shared https://github.com/dtothefp/isomorphic-demo/blob/master/app/index.js. Unfortunately, it is on a private repo so I can't share it here.

Essentially, it uses the babel/register and kicks off the process of rendering HTML from a React component. The problem is that this react component imports many internal modules (on our internal NPM registry, some of which are themselves react component libraries) that are written in es6 and NOT pre-compiled. I wrote a small script that uses the babel ignore property to include these external modules in es6 compilation https://babeljs.io/docs/usage/require/#specifying-options and this works great locally, the HTML compiles in about 2 seconds or less.

The problem is we are running this on an AWS lamda, and in that environment, importing the component results in compile times greater than 30s. I would like to pre-compile the modules or potentially pre-compile the whole script that contains the webpack-isomorphic-tools entry i.e.

  tools.development(isDev).server(statsDir).then(() => {
    const runLambda = require('./lambda-function');
     runLambda(templatingArgs, cb);
  });

I'm just wondering if this breaks some of the require magic or if require hooks will still be established regardless by webpack-isomorphic-tools if code is pre-compiled through babel and not run through the babel/register?

[error] asset not found: ./node_modules/font-awesome/css/font-awesome.css

My build seems to function just fine and also these styles seem to be being included as the Icons are displaying... but I still get this error.

[webpack-isomorphic-tools] [debug]  registering a require() hook for *.scss
[webpack-isomorphic-tools] [debug]  registering a require() hook for *.styl
[webpack-isomorphic-tools] [debug] require() hook fired for /Users/tomatao/Projects/app/node_modules/font-awesome/css/font-awesome.css
[webpack-isomorphic-tools] [debug] requiring ./node_modules/font-awesome/css/font-awesome.css
[webpack-isomorphic-tools] [error] asset not found: ./node_modules/font-awesome/css/font-awesome.css
[webpack-isomorphic-tools] [debug] require() hook fired for /Users/tomatao/Projects/app/src/app/components/App.module.scss
[webpack-isomorphic-tools] [debug] requiring ./src/app/components/App.module.scss

The errored CSS file in question is being required by ./node_modules/react-fa and not by my source code.

The paths listed in debug are correct and available.

How can I deal with this warning appropriately?

webpackConfig = {
  resolve: {
    root: paths.APP,
    modulesDirectories: [ 'node_modules', paths.STYLE ],
    extensions: [
      '', '.js', '.jsx', '.es6'
    ]
  },
...
  module: {
    loaders: [{
      test: /\.css$/, include: [/src\/app/, /awesome/],
      loader: ExtractTextPlugin.extract('style', 'css')
    }, {
...
  plugins: [
    new webpack.HotModuleReplacementPlugin(),
    new IsomorphicToolsPlugin(isomorphicConfig).development()
...

Relative paths on require() call don't match the values in webpack-assets.json

Hi,

I have quite unusual way of configuring webpack. We have multiple projects with similar architecture, so we are trying to reuse webpack configuration.

I created an example of project structure we are using, webpack configuration is encapsulated here, so you could reproduce the issues I'm having.

1st case

Path of required style doesn't match path in webpack-assets.json. Style is required from shared component which is in node_modules.

  1. Open http://localhost:3000/
  2. Error is thrown:
[1] [webpack-isomorphic-tools] [error] asset not found: ./~/react-shared-library-example/dist/components/MyStyledComponent.scss
[1] /Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react-shared-library-example/dist/components/MyStyledComponent.js:29
[1]       { className: styles.wrapper },
[1]                          ^
[1] 
[1] TypeError: Cannot read property 'wrapper' of undefined
[1]     at MyStyledComponent.render (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react-shared-library-example/dist/components/MyStyledComponent.js:29:26)
[1]     at [object Object].ReactCompositeComponentMixin._renderValidatedComponentWithoutOwnerOrContext (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactCompositeComponent.js:587:34)
[1]     at [object Object].ReactCompositeComponentMixin._renderValidatedComponent (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactCompositeComponent.js:607:32)
[1]     at [object Object].wrapper [as _renderValidatedComponent] (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactPerf.js:66:21)
[1]     at [object Object].ReactCompositeComponentMixin.mountComponent (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactCompositeComponent.js:220:30)
[1]     at [object Object].wrapper [as mountComponent] (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactPerf.js:66:21)
[1]     at Object.ReactReconciler.mountComponent (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactReconciler.js:37:35)
[1]     at ReactDOMComponent.ReactMultiChild.Mixin.mountChildren (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactMultiChild.js:241:44)
[1]     at ReactDOMComponent.Mixin._createContentMarkup (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactDOMComponent.js:591:32)
[1]     at ReactDOMComponent.Mixin.mountComponent (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactDOMComponent.js:479:29)

2nd case

Webpack-assets.json contains absolute path /Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/modules/components/About.scss, but relative one ./modules/components/About.scss is required.

  1. Open http://localhost:3000/about
  2. Error is thrown:
[1] [webpack-isomorphic-tools] [error] asset not found: ./modules/components/About.scss
[1] /Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/modules/components/About.js:28
[1]       { className: styles.wrapper },
[1]                          ^
[1] 
[1] TypeError: Cannot read property 'wrapper' of undefined
[1]     at About.render (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/modules/components/About.js:7:29)
[1]     at [object Object].ReactCompositeComponentMixin._renderValidatedComponentWithoutOwnerOrContext (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactCompositeComponent.js:587:34)
[1]     at [object Object].ReactCompositeComponentMixin._renderValidatedComponent (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactCompositeComponent.js:607:32)
[1]     at [object Object].wrapper [as _renderValidatedComponent] (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactPerf.js:66:21)
[1]     at [object Object].ReactCompositeComponentMixin.mountComponent (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactCompositeComponent.js:220:30)
[1]     at [object Object].wrapper [as mountComponent] (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactPerf.js:66:21)
[1]     at Object.ReactReconciler.mountComponent (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactReconciler.js:37:35)
[1]     at ReactDOMComponent.ReactMultiChild.Mixin.mountChildren (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactMultiChild.js:241:44)
[1]     at ReactDOMComponent.Mixin._createContentMarkup (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactDOMComponent.js:591:32)
[1]     at ReactDOMComponent.Mixin.mountComponent (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactDOMComponent.js:479:29)

webpack-assets.json:

{
  "javascript": {
    "main": "http://localhost:3001/dist/main-8f70bcb9f4f52c2339c4.js"
  },
  "styles": {},
  "assets": {
    "../react-shared-library-example/dist/components/MyStyledComponent.scss": {
      "wrapper": "wrapper___398WI",
      "content": "content___2ECOw",
      "_style": ".wrapper___398WI {\n  width: 100%;\n  padding: 10px;\n}\n\n.wrapper___398WI .content___2ECOw {\n  width: 300px;\n  height: 60px;\n  margin: 0 auto;\n  background-color: #666;\n}\n"
    },
    "/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/modules/components/About.scss": {
      "wrapper": "wrapper___1Qxgf",
      "_style": ".wrapper___1Qxgf {\n  background-color: #222222;\n}\n"
    }
  }
}

Also, you can find webpack isomorphic tools config here.

Most likely the roots of these issues are in encapsulated webpack config and I'm the only one who have them, but maybe changing paths in webpack-assets.json to absolute ones would help? Any thoughts on that?

Any help or advices would be highly appreciated.

Question: Compilation of Server Bundle

This is probably a stupid question but I'm just trying to figure out how to get up and running with this module as it looks very useful, but I'm confused at what the server method does. When I pass my ./server entry point as the second argument to new webpack-isomorphic-tools(), what is actually happening? Is it just relying on a webpack compilation of client code to have happened that output a webpack stat.json file into the root of the context directory, or does webpack-isomorphic-tools actually bundle (with webpack) and output my ./server bundle in a target=node webpack config environment. Sorry for my confusion but not sure I'm understanding the functionality of this module completely.

Using Handlebars templating over the server HTML component?

I'm trying to integrate webpack-isomorphic-tools with my project, which already uses Handlebars for rendering the root HTML page (via Express's view engine feature) and then embedding the root React component into the page, and was wondering what issues would arise or disadvantages I would have if I opt to use Handlebars over the example HTML component shown in the examples?

Npm link does not work

Hello, first of all thanks for this awesome tool.
We have two packages currently, one of them use another one. We also use css-modules if this matter.
When I npm publish and then npm i everything is fine, webpack-assets.json generates normally.
But when I npm link I have this error

[0] [webpack-isomorphic-tools/plugin] [error] -----------------------------------------------------------------
[0] [webpack-isomorphic-tools/plugin] [error] Asset with path "../topico-content/styles/bootstrap/bootstrap-build.scss" was overwritten because of path collision.
[0] [webpack-isomorphic-tools/plugin] [error] Use the "filter" function of this asset type to narrow the results.
[0] [webpack-isomorphic-tools/plugin] [error] Previous asset with this path:
[0] [webpack-isomorphic-tools/plugin] [error] var __webpack_public_path__ = "http://localhost:3001/dist/";
[0] exports = module.exports = require("./../../node_modules/css-loader/lib/css-base.js")();

Please write me back if you need any additional info.

Use with webpack-dev-middleware?

I can't use webpack's dev server as is so I just include the webpack-dev-middleware in my server file, it looks something like this:

const compiler = webpack(config);
app.use(require('webpack-dev-middleware')(compiler, {
    noInfo: true,
    publicPath: config.output.publicPath
  }));

The problem (I think) is that since I'm calling webpack-isomorphic-tools before the dev-server is set up, there's no stats file to be found & it just infinitely tries to find it ([webpack-isomorphic-tools] (waiting for the first Webpack build to finish)). Is there a way to get the two to play nicely?

does not write webpack-assets.json to location specified as rootDir

Following the example here: https://github.com/erikras/react-redux-universal-hot-example/blob/master/bin/server.js#L4 I'm attempting to change rootDir to another path, in order to better externalize my source from the boilerplate code. For example, I'd like to change that to var rootDir = path.resolve(__dirname, '../external'); I also then update the context to point to the same path, so that the tools can find the webpack-assets.json.

Unfortunately, what I see is that it is writing the file into the project root, rather than what I'm specifying.

If I add logs to here: https://github.com/halt-hammerzeit/webpack-isomorphic-tools/blob/master/source/index.js#L149

        console.log('setting up project path', this.options.project_path);
        console.log('setting up webpack assets path', this.webpack_assets_path);

I get the following output:

[1] setting up project path /Users/d4/code/react-redux-universal-hot-example-fork/external
[1] setting up webpack assets path /Users/d4/code/react-redux-universal-hot-example-fork/external/webpack-assets.json

But then webpack-assets.json is written to the project root and it never finds them, so I see endless logs like the following:

[1] [webpack-isomorphic-tools] (waiting for the first Webpack build to finish)

I'm running version 2.2.18

Please update docs on potentia issues

I'm not sure how to interpret below message. After I followed all steps in the documentation and ran webpack on dev configuration, I get below error, what does it mean? I did not setup a webpack-dev-server.

[webpack-isomorphic-tools] (waiting for the first Webpack build to finish)
[webpack-isomorphic-tools] (waiting for the first Webpack build to finish)
[webpack-isomorphic-tools] (waiting for the first Webpack build to finish)

Support webpack resolve.modulesDirectories

https://github.com/erikras/react-redux-universal-hot-example currently uses NODE_PATH to get around that more or less (despite using NODE_PATH actually being actively discouraged by the Node community).

But it's still not as powerful as webpacks modulesDirectories which basically travels up the directory hierarchy until it finds one of the given directory names at which point it starts looking for the given module inside it.

Are there any plans for supporting webpack's resolve.modulesDirectories?

Bootstrap svg

Could you please help me with this?

Why is it twice there?

terminal

[webpack-isomorphic-tools/plugin] [error] -----------------------------------------------------------------
[webpack-isomorphic-tools/plugin] [error] Asset with path "./~/bootstrap/fonts/glyphicons-halflings-regular.svg" was overwritten because of path collision.
[webpack-isomorphic-tools/plugin] [error] Use the "filter" function of this asset type to narrow the results.
[webpack-isomorphic-tools/plugin] [error] Previous asset with this path:
[webpack-isomorphic-tools/plugin] [error] var __webpack_public_path__ = "http://localhost:8082/dist/";
module.exports = __webpack_public_path__ + "89889688147bd7575d6327160d64e760.svg"
[webpack-isomorphic-tools/plugin] [error] New asset with this path:
[webpack-isomorphic-tools/plugin] [error] var __webpack_public_path__ = "http://localhost:8082/dist/";
module.exports = __webpack_public_path__ + "89889688147bd7575d6327160d64e760.svg"
[webpack-isomorphic-tools/plugin] [error] -----------------------------------------------------------------

https://github.com/solcik/js-universal/pull/17

index.js

import bootstrap from 'bootstrap/less/bootstrap.less';

webpack-config

{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: 'url', query: {limit: '10000', mimetype: 'image/svg+xml'} },

isomorphic-tools-config

    svg: {
      extension: 'svg',
      parser: WebpackIsomorphicToolsPlugin.url_loader_parser
    },

debug

[webpack-isomorphic-tools/plugin] [debug] parsing assets of type "svg"
[webpack-isomorphic-tools/plugin] [trace] Adding assset "./~/bootstrap/fonts/glyphicons-halflings-regular.svg", module id 1090 (in webpack-stats.debug.json)
[webpack-isomorphic-tools/plugin] [error] -----------------------------------------------------------------
[webpack-isomorphic-tools/plugin] [error] Asset with path "./~/bootstrap/fonts/glyphicons-halflings-regular.svg" was overwritten because of path collision.
[webpack-isomorphic-tools/plugin] [error] Use the "filter" function of this asset type to narrow the results.
[webpack-isomorphic-tools/plugin] [error] Previous asset with this path:
[webpack-isomorphic-tools/plugin] [error] var __webpack_public_path__ = "http://localhost:8082/dist/";
module.exports = __webpack_public_path__ + "89889688147bd7575d6327160d64e760.svg"
[webpack-isomorphic-tools/plugin] [error] New asset with this path:
[webpack-isomorphic-tools/plugin] [error] var __webpack_public_path__ = "http://localhost:8082/dist/";
module.exports = __webpack_public_path__ + "89889688147bd7575d6327160d64e760.svg"
[webpack-isomorphic-tools/plugin] [error] -----------------------------------------------------------------
[webpack-isomorphic-tools/plugin] [debug]  time taken: 4 ms
[webpack-isomorphic-tools/plugin] [debug] parsing assets of type "style_modules"
[webpack-isomorphic-tools/plugin] [trace] Adding assset "./~/basscss-base-reset/index.css", module id 177 (in webpack-stats.debug.json)
[webpack-isomorphic-tools/plugin] [trace] Adding assset "./~/normalize.css/normalize.css", module id 178 (in webpack-stats.debug.json)
[webpack-isomorphic-tools/plugin] [trace] Adding assset "./~/bootstrap/less/bootstrap.less", module id 179 (in webpack-stats.debug.json)
[webpack-isomorphic-tools/plugin] [trace] Adding assset "./assets/index.scss", module id 180 (in webpack-stats.debug.json)
[webpack-isomorphic-tools/plugin] [trace] Adding assset "./~/font-awesome/scss/font-awesome.scss", module id 181 (in webpack-stats.debug.json)
[webpack-isomorphic-tools/plugin] [trace] Adding assset "./src/common/pages/App/App.scss", module id 182 (in webpack-stats.debug.json)
[webpack-isomorphic-tools/plugin] [debug]  time taken: 4 ms
[require-hook] [debug] Hooking into *.webpack-module files loading
[webpack-isomorphic-tools/plugin] [debug] compiling assets
[require-hook] [debug] Loading source code for C:\Users\david\www\_github\js-universal\~\bootstrap\fonts\glyphicons-halflings-regular.svg.webpack-module
[require-hook] [debug] Loading source code for C:\Users\david\www\_github\js-universal\~\bootstrap\fonts\glyphicons-halflings-regular.woff.webpack-module
[require-hook] [debug] Loading source code for C:\Users\david\www\_github\js-universal\~\bootstrap\fonts\glyphicons-halflings-regular.woff2.webpack-module
[require-hook] [debug] Loading source code for C:\Users\david\www\_github\js-universal\~\bootstrap\fonts\glyphicons-halflings-regular.ttf.webpack-module
[require-hook] [debug] Loading source code for C:\Users\david\www\_github\js-universal\~\basscss-base-reset\index.css.webpack-module
[require-hook] [debug] Loading source code for ./../css-loader/lib/css-base.js.webpack-module
[require-hook] [debug] Loading source code for C:\Users\david\www\_github\js-universal\~\normalize.css\normalize.css.webpack-module
[require-hook] [debug] Loading source code for C:\Users\david\www\_github\js-universal\~\bootstrap\less\bootstrap.less.webpack-module
[require-hook] [debug] Loading source code for ./../../css-loader/lib/css-base.js.webpack-module
[require-hook] [debug] Loading source code for ../fonts/glyphicons-halflings-regular.eot.webpack-module
[require-hook] [debug] Loading source code for ../fonts/glyphicons-halflings-regular.woff2.webpack-module
[require-hook] [debug] Loading source code for ../fonts/glyphicons-halflings-regular.woff.webpack-module
[require-hook] [debug] Loading source code for ../fonts/glyphicons-halflings-regular.ttf.webpack-module
[require-hook] [debug] Loading source code for ../fonts/glyphicons-halflings-regular.svg.webpack-module
[require-hook] [debug] Loading source code for C:\Users\david\www\_github\js-universal\assets\index.scss.webpack-module
[require-hook] [debug] Loading source code for ./../node_modules/css-loader/lib/css-base.js.webpack-module
[require-hook] [debug] Loading source code for C:\Users\david\www\_github\js-universal\~\font-awesome\scss\font-awesome.scss.webpack-module
[require-hook] [debug] Loading source code for ../fonts/fontawesome-webfont.eot?v=4.4.0.webpack-module
[require-hook] [debug] Loading source code for ../fonts/fontawesome-webfont.eot.webpack-module
[require-hook] [debug] Loading source code for ../fonts/fontawesome-webfont.woff2?v=4.4.0.webpack-module
[require-hook] [debug] Loading source code for ../fonts/fontawesome-webfont.woff?v=4.4.0.webpack-module
[require-hook] [debug] Loading source code for ../fonts/fontawesome-webfont.ttf?v=4.4.0.webpack-module
[require-hook] [debug] Loading source code for ../fonts/fontawesome-webfont.svg?v=4.4.0.webpack-module
[require-hook] [debug] Loading source code for C:\Users\david\www\_github\js-universal\src\common\pages\App\App.scss.webpack-module
[require-hook] [debug] Loading source code for ./../../../../node_modules/css-loader/lib/css-base.js.webpack-module
[webpack-isomorphic-tools/plugin] [debug]  time taken: 23 ms
[webpack-isomorphic-tools/plugin] [debug] writing webpack assets info to C:\Users\david\www\_github\js-universal\webpack-stats.json
webpack built e19c21cc8f123e2a2aec in 7752ms
[require-hook] [debug] Loading source code for C:\Users\david\www\_github\js-universal\assets\index.scss
[webpack-isomorphic-tools] [debug] require() called for C:\Users\david\www\_github\js-universal\assets\index.scss
[webpack-isomorphic-tools] [debug]  requiring ./assets/index.scss
[require-hook] [debug] Loading source code for C:\Users\david\www\_github\js-universal\node_modules\font-awesome\scss\font-awesome.scss
[webpack-isomorphic-tools] [debug] require() called for C:\Users\david\www\_github\js-universal\node_modules\font-awesome\scss\font-awesome.scss
[webpack-isomorphic-tools] [debug]  requiring ./~/font-awesome/scss/font-awesome.scss
[require-hook] [debug] Loading source code for C:\Users\david\www\_github\js-universal\node_modules\normalize.css\normalize.css
[webpack-isomorphic-tools] [debug] require() called for C:\Users\david\www\_github\js-universal\node_modules\normalize.css\normalize.css
[webpack-isomorphic-tools] [debug]  requiring ./~/normalize.css/normalize.css
[require-hook] [debug] Loading source code for C:\Users\david\www\_github\js-universal\node_modules\basscss-base-reset\index.css
[webpack-isomorphic-tools] [debug] require() called for C:\Users\david\www\_github\js-universal\node_modules\basscss-base-reset\index.css
[webpack-isomorphic-tools] [debug]  requiring ./~/basscss-base-reset/index.css
[require-hook] [debug] Loading source code for C:\Users\david\www\_github\js-universal\node_modules\bootstrap\less\bootstrap.less
[webpack-isomorphic-tools] [debug] require() called for C:\Users\david\www\_github\js-universal\node_modules\bootstrap\less\bootstrap.less
[webpack-isomorphic-tools] [debug]  requiring ./~/bootstrap/less/bootstrap.less
[require-hook] [debug] Loading source code for C:\Users\david\www\_github\js-universal\src\common\pages\App\App.scss
[webpack-isomorphic-tools] [debug] require() called for C:\Users\david\www\_github\js-universal\src\common\pages\App\App.scss [webpack-isomorphic-tools] [debug]  requiring ./src/common/pages/App/App.scss
==> Api is available at /api/v1
==> Frontend is available at /
==> Open http://localhost:8081 in a browser to view the app.

switching between development and production

Hey,

thanks for the effort in this little plugin. this is definitely a part of webpack that is missing out-of-the-box.

anyways. i got an weird question... maybe i am using or understanding something not as intended.
you can take a look at my repo. I've sucessfully implemented dynamically isomorphic chunks of js and css. I am doing my finishing touches to release a 'production-ready' version of it.

So, please try starting the server locally with npm run dev. It successfully bundles all dynamic chunks and offers it.
Next, stop the server and try to run the server in production with npm start. It bundles all chunks as well - with chunkhash names (for caching)... The server-side rendering is working too. But as soon as you open http://localhost:3000 - and open the console - you will see, that the server-side rendered Html.jsx is referencing to the chunk files previously build in development mode.

When you restart the production server, it will work fine.

It seems that webpack-isomorphic-tools is refferencing to the webpack-assets.json before the new files are even parsed by webpack and babel... (just an idea :D )

Just out of curiosity i cloned https://github.com/erikras/react-redux-universal-hot-example and tried the same thing - same behaviour.

Am I missing something? Thanks!

Unexptected reserved word "import".

I get an error coming from the webpack-isomorphic-tools-configuration.js file which is

[0] /Users/rparent/Documents/CTSProjects/isomorphic-boiler-plate/webpack-isomorphic-tools-configuration.js:1
[0] (function (exports, require, module, __filename, __dirname) { import Webpack_i
[0]                                                               ^^^^^^
[0] SyntaxError: Unexpected reserved word
[0]     at exports.runInThisContext (vm.js:73:16)
[0]     at Module._compile (module.js:443:25)
[0]     at Object.Module._extensions..js (module.js:478:10)
[0]     at Module.load (module.js:355:32)
[0]     at Function.Module._load (module.js:310:12)
[0]     at Module.require (module.js:365:17)
[0]     at require (module.js:384:17)
[0]     at Object.<anonymous> (/Users/rparent/Documents/CTSProjects/isomorphic-boiler-plate/webpack.client.js:4:75)
[0]     at Module._compile (module.js:460:26)
[0]     at Object.Module._extensions..js (module.js:478:10)

Tried to modify it with the require() method instead then got the same error but with the export word on line 3. I am probably doing something wrong.

This is the line 4 of my webpack.client.js file which is my webpack configuration.

var webpack_isomorphic_tools_plugin = new Webpack_isomorphic_tools_plugin(require('./webpack-isomorphic-tools-configuration')).development();

Any help would be appreciated!

Asset named was overwritten because of naming collision

Hi,
I have this annoying error which pops for all my stylus files.
But for all assets there is no previous asset name.
By looking into your code I saw that you check if set[name] exists, I don't know if it's the source of the problem.
And I have the same config than the react-redux-universal-hot-example (Edited for my stylus workflow).
Thx for your work on this package.

[webpack-isomorphic-tools/plugin] [error] Asset named "./src/containers/Admin/Admin.styl" was overwritten because of naming collision
[webpack-isomorphic-tools/plugin] [error] Previous asset with this name:
[webpack-isomorphic-tools/plugin] [error] {}
[webpack-isomorphic-tools/plugin] [error] New asset with this name:
[webpack-isomorphic-tools/plugin] [error] {
  "main": "_1iRH-ONbSK1CGc6I5IsK9i",
  "tabContainer": "QfukX2oXI1azlGfa6ibOX",
  "tab": "_1l2nv09Vh1dnxnavUMdKWG",
  "active": "_2OkJ1Bs11RK_fcRjXXjNhJ",
  "container": "_176uI5088uL1KXBjyuydZA",
  "element": "_2FeDilt7oX6weGVPPx43LF"
}

Cannot read property './webpack-assets.json' of undefined

Hi,

I am using the json-loader and when I try to use webpack-isomorphic-tools I get this error server-side:

local ~/Codes/webpack-iso $ npm start
...
[require-hook] [debug] Loading source code for /Users/me/Codes/webpack-iso/webpack-assets.json
[webpack-isomorphic-tools] [debug] require() called for /Users/me/Codes/webpack-iso/webpack-assets.json
[webpack-isomorphic-tools] [debug]  requiring ./webpack-assets.json
/Users/me/Codes/webpack-iso/node_modules/webpack-isomorphic-tools/babel-transpiled-modules/index.js:345
        var asset = assets[asset_path];
                          ^

TypeError: Cannot read property './webpack-assets.json' of undefined
    at webpack_isomorphic_tools.asset_source (/Users/me/Codes/webpack-iso/node_modules/webpack-isomorphic-tools/babel-transpiled-modules/index.js:345:21)
    at webpack_isomorphic_tools.require (/Users/me/Codes/webpack-iso/node_modules/webpack-isomorphic-tools/babel-transpiled-modules/index.js:327:70)
    at /Users/me/Codes/webpack-iso/node_modules/webpack-isomorphic-tools/babel-transpiled-modules/index.js:294:18
...

I have created a repo with minimal code to reproduce the issue here: https://github.com/happypoulp/webpack-isomorphic

Here is the webpack config that I use: https://github.com/happypoulp/webpack-isomorphic/blob/master/webpack.config.js
and here is the webpack isomorphic tools config I use: https://github.com/happypoulp/webpack-isomorphic/blob/master/webpack-isomorphic-tools.config.js

The webpack compilation is running well and the webpack-assets.json actually exists so I don't understand what I'm missing. May that be an issue with webpack-isomorphic-tools?

Thanks for your help.

Need help with iconfont-loader

Hi,

I am not sure I correctly understand how to use the loader iconfont-loader with webpack-isomorphic-tools.

I try to use iconfont-loader that allows to import an svg to be used as a font-icon. When I specify an asset type for .svg in webpack isomorphic tools, I get an error during webpack compilation:

[webpack-isomorphic-tools/plugin] [debug] running write assets webpack plugin
[webpack-isomorphic-tools/plugin] [debug]  (development mode is on)
[webpack-isomorphic-tools/plugin] [debug] writing webpack stats to /Users/me/Codes/webpack-iso/webpack-stats.json
[webpack-isomorphic-tools/plugin] [debug] getting javascript and styles for chunk "main"
[webpack-isomorphic-tools/plugin] [debug]  (got javascript)
[webpack-isomorphic-tools/plugin] [debug] No filter specified for "json" assets. Using a default one.
[webpack-isomorphic-tools/plugin] [debug] No path parser specified for "json" assets. Using a default one.
[webpack-isomorphic-tools/plugin] [debug] No parser specified for "json" assets. Using a default one.
[webpack-isomorphic-tools/plugin] [debug] parsing assets of type "json"
[webpack-isomorphic-tools/plugin] [trace] Adding assset "./file.json", module id 9 (in webpack-stats.debug.json)
[webpack-isomorphic-tools/plugin] [debug]  time taken: 0 ms
[webpack-isomorphic-tools/plugin] [debug] No filter specified for "svg" assets. Using a default one.
[webpack-isomorphic-tools/plugin] [debug] No path parser specified for "svg" assets. Using a default one.
[webpack-isomorphic-tools/plugin] [debug] parsing assets of type "svg"
[webpack-isomorphic-tools/plugin] [trace] Adding assset "./svg/icon-list.svg", module id 10 (in webpack-stats.debug.json)
[webpack-isomorphic-tools/plugin] [trace] Adding assset "./svg/icon-search.svg", module id 12 (in webpack-stats.debug.json)
[webpack-isomorphic-tools/plugin] [debug]  time taken: 1 ms
[webpack-isomorphic-tools/plugin] [debug] No parser specified for "scss" assets. Using a default one.
[webpack-isomorphic-tools/plugin] [debug] parsing assets of type "scss"
[webpack-isomorphic-tools/plugin] [trace] Adding assset "./base.scss", module id 3 (in webpack-stats.debug.json)
[webpack-isomorphic-tools/plugin] [trace] Adding assset "./mod-1.scss", module id 8 (in webpack-stats.debug.json)
[webpack-isomorphic-tools/plugin] [debug]  time taken: 0 ms
[webpack-isomorphic-tools/plugin] [debug] compiling assets
[webpack-isomorphic-tools/plugin] [debug] require()ing "/Users/me/Codes/webpack-iso/file.json"
[webpack-isomorphic-tools/plugin] [debug]  found in parsed assets
[webpack-isomorphic-tools/plugin] [debug] require()ing "/Users/me/Codes/webpack-iso/svg/icon-list.svg"
[webpack-isomorphic-tools/plugin] [debug]  found in parsed assets
[webpack-isomorphic-tools/plugin] [debug] require()ing "iconfont-loader"
[webpack-isomorphic-tools/plugin] [debug]  not found in parsed assets, searching in webpack stats
[webpack-isomorphic-tools/plugin] [debug]  found in webpack stats, module id 11
iconfont-loader.webpack-module:10
var CODEPOINTS = __FONT_ICON_PLUGIN_CODEPOINTS__;
                 ^

ReferenceError: __FONT_ICON_PLUGIN_CODEPOINTS__ is not defined
    at Object.<anonymous> (iconfont-loader.webpack-module:10:18)
    at Module._compile (module.js:434:26)

It seems that .svg assets are correctly added but at some point, when requiring one, it also require("iconfont-loader") and this seems to trigger an error. I think it may be due to the way iconfont-loader is written and I can't find a way to make it work with webpack-isomorphic-tools. I tried using parser option but I think the issue occurs after parsing it done.

Here is a repo + branch where I reproduce the issue: https://github.com/happypoulp/webpack-isomorphic/tree/iconfont-loader and the specific commit where I added iconfont-loader: happypoulp/webpack-isomorphic@8165c27

Can you help me on that or give me guidance about where I should look for similar loader behavior that works server-side?

Thanks!

When using json-loader, require(file.json) is broken for server-only libs

Hi,

I got this error when using json-loader + express:

[webpack-isomorphic-tools] [error] asset not found: ./~/statuses/codes.json
/app/node_modules/statuses/index.js:7
status.codes = Object.keys(codes).map(function (code) {
                      ^

TypeError: Cannot convert undefined or null to object
    at Function.keys (native)
    at Object.<anonymous> (/app/node_modules/statuses/index.js:7:23)
    at Module._compile (module.js:435:26)
    at Module._extensions..js (module.js:442:10)
    at Object.require.extensions.(anonymous function) [as .js] (/app/node_modules/babel-core/lib/api/register/node.js:214:7)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/app/node_modules/http-errors/index.js:2:16)

It seems that webpack-isomorphic-tools new require is trying to handle resources that are only used server-side (like express).

Here is the webpack-isomorphic-tools config that I use:

export default {
  debug: true,
  assets: {
    json: {
      extensions: ['json']
    },
    svg: {
      extensions: ['svg']
    },
    scss: {
      extensions: ['scss']
    },
  }
}

Thanks.

Overriding require() hook for file extension .js

Hi, I am getting the following error on build:

[require-hook] [warning] -------------------------------------------------------------
[1] [require-hook] [warning] Overriding require() hook for file extension .js
[1] [require-hook] [warning] -------------------------------------------------------------

Upgrade to Babel 6

I just upgraded my project to babel 6 and am receiving the following error.

_error given was: Error: Cannot find module 'glob'
at Function.Module._resolveFilename (module.js:337:15)
at Function._module3.default.resolveFilename (/Users/sridattap/Applications/frontend/node_modules/webpack-isomorphic-tools/node_modules/require-hacker/babel-transpiled-modules/require hacker.js:403:34)

Any plans to upgrade this project and require-hacker to babel 6??

Setting up initial cache before starting the server

I just started deploying an universal app using these tools.

I've noticed that the first request after I deploy is really slow, then subsequent requests are fast.

From this: #17 I'm guessing it has to do with building that initial cache. Is there a way I can trigger building this before the server starts?

I'm using these tools via:

var WebpackIsomorphicTools = require('webpack-isomorphic-tools');
global.webpackIsomorphicTools = new WebpackIsomorphicTools(require('../webpack/webpack-isomorphic-tools'))
    .development(__LOCAL__)
    .server(rootDir, function() {
        require('../src/server');
    });

Include styles in stats extracted by ExtractTextPlugin

I updated to new tools config and parsers/filters. All works fine when I'm doing a build without extracting styles for local css using ExtractTextPlugin. When I do my prod build extracted styles are not included in stats. Is there a way for me to include extracted styles in stats as I will need to use these for my prod server side builds?

tools-config.js

export default function({isMainTask, isDev, sources}) {
  const {statsFile, globalStatsFile, buildDir} = sources;
  const toolsFile = `../${path.join(buildDir, isMainTask ? statsFile : globalStatsFile)}`;
  const defaultConfig = {
    debug: isDev,
    webpack_assets_file_path: toolsFile
  };

  const config = {
    isomporphic: {
      debug: true,
      assets: {
        images: {
          extensions: [
            'jpeg',
            'jpg',
            'png',
            'gif',
            'svg'
          ],
          parser: WebpackIsomorphicToolsPlugin.url_loader_parser
        },
        styles: {
          extensions: ['css', 'scss'],
          filter: WebpackIsomorphicToolsPlugin.style_loader_filter,
          path: WebpackIsomorphicToolsPlugin.style_loader_path_extractor,
          parser: WebpackIsomorphicToolsPlugin.css_loader_parser
        }
      }
    },
    global: {
      assets: {
        images: {
          extensions: [
            'jpeg',
            'jpg',
            'svg',
            'png',
            'gif'
          ],
          filter(m, regex, options, log) {
            const {name} = m;
            return regex.test(name);
          },
          parser(m, options, log) {
            const {publicPath} = options.webpack_stats;
            const [fullName] = m.assets;
            return process.env.TRAVIS_BRANCH ? publicPath  +  fullName : `/${fullName}`;
          },
          path(m, options, log) {
            const {name} = m;
            const base = path.basename(name);
            return base;
          }
        }
      }
    }
  };

  const toolsConfig = isMainTask ? config.isomporphic : config.global;

  return merge({}, defaultConfig, toolsConfig);
}

instantiate-tools.js

import WebpackIsomorphicTools from 'webpack-isomorphic-tools';
import WebpackIsomorphicToolsPlugin from 'webpack-isomorphic-tools/plugin';
import makeToolsConfig from './config';

export default function({isPlugin, isMainTask, isDev, sources}) {
  const toolsConfig = makeToolsConfig({isMainTask, isDev, sources});
  let tools;

  if (isPlugin) {
    tools = new WebpackIsomorphicToolsPlugin(toolsConfig).development(isDev);
  } else {
    tools = new WebpackIsomorphicTools(toolsConfig).development(isDev);
  }

  return tools;
}

dev-stats.json

{
  "javascript": {
    "vendors": "/js/vendors.js",
    "main": "/js/main.js"
  },
  "styles": {},
  "assets": {
    "./src/js/components/local.css": ".local__whatevss___2PYX3 {\n  background: goldenrod;\n}\n\n.local__hello___2adpY {\n  background: lavenderblush;\n}\n"
  }
}

prod-stats.json //missing local styles here

{
  "javascript":{
    "vendors":"/js/vendors.js","main":"/js/main.js"
  },"styles":{
  "main":"/css/main.css"
  },"assets":{}
}

Also, is there a way to specify the name of the debug stats file? Looks like it's writing to webpack-stats.json and when I'm running two tasks that generate stats it gets overwritten

Not working with webpack's resolve.alias?

Basically I want to separate my themes (scss, icons, etc) out from my web app project. So each theme is a npm module under node_modules. In my component I have:

import Styles from 'theme/sass/user.scss';

And in webpack config there is:

resolve: {
    ...
    alias: { 'theme': 'theme-a' }
}

Therefore I can easily change active theme by changing the alias here.

However since it's an isomorphic app, when it renders on server side it gives:

 Cannot find module 'theme/sass/user.scss'

If in component I hardcode it to import Styles from 'theme-a/sass/user.scss'; and remove the resolve alias, everything works. (which means webpack-isomorphic-tools works well with node_modules I think).

Is there a possibility to call "webpackIsomorphicTools.refresh();" outside of rendering middleware?

Hello,

I have wepback configured with webpack-isomorphic-tools and encapsulated in npm package by custom CLI, so several projects can share the same webpack setup. Rendering middleware is outside of npm package containing webpack-isomorphic-tools, so I'm trying to avoid any references to webpack-isomorphic-tools on the project level.

Is there a way to keep hot module replacement feature and do not have webpackIsomorphicTools.refresh(); in middleware in the same time?

Thanks,
Sergey

Checksum mismatch

Sorry, changed the issue completely as I figured this out. I have this problem now:

Warning: React attempted to reuse markup in a container but the checksum was invalid. This generally means that you are using server rendering and the markup generated on the server was not what the client was expecting. React injected new markup to compensate which works but you have lost many of the benefits of server rendering. Instead, figure out why the markup being generated is different on the client or server:
 (client) 1fzsg6oe4u8.0"><div class="_3M_6s6ONPXQz
 (server) 1fzsg6oe4u8.0"><div data-reactid=".1fzsg

Seems that the server has not loaded the CSS accordingly and my client is doing that work.

webpack-assets.json

Hello,

I am wondering why my css file is under assets property of the webpack-assets.json

/ isomorphic configuration

var path = require('path');
var WebpackIsomorphicToolsPlugin = require('webpack-isomorphic-tools/plugin');

module.exports = {
  webpack_assets_file_path: '../build/webpack-assets.json',

  assets: {
    styles: {
      extension: 'css',
      filter: WebpackIsomorphicToolsPlugin.style_loader_filter,
      path: WebpackIsomorphicToolsPlugin.style_loader_path_extractor,
      parser: WebpackIsomorphicToolsPlugin.css_loader_parser
    }
  }
};
// result webpack-assets.json
{ javascript: { main: '/bundle.js' },
  styles: {},
  assets: { './common/components/index.css': 'body {\n  background: red;\n}\n\nh1 {\n  color: white;\n}' } }

shouldn't webpack-assets.json be this

// result webpack-assets.json
{ javascript: { main: '/bundle.js' },
  styles: { './common/components/index.css': 'body {\n  background: red;\n}\n\nh1 {\n  color: white;\n}' } }

composing css modules throws error

I'm working with @erikras redux boilerplate which recently integrated webpack-isomorphic-tools and I've noticed that I cannot use the composes feature of css-loader as documented here: https://github.com/webpack/css-loader#composing-css-classes. In order to use flexboxgrid, a responsive styling library, I would like add the following to my App.scss:

:local(.appContainer) {
  composes: row from 'flexboxgrid/dist/flexboxgrid.css';
  margin: 20px;
}

But I get the following error:

[0] /[REDACTED]/node_modules/webpack-isomorphic-tools/babel-transpiled-modules/plugin/write assets.js:202
[0]         throw _iteratorError;
[0]               ^
[0] SyntaxError: Unexpected token +
[0]     at Object.parse (native)

Full error gist is here: https://gist.github.com/bdefore/60b3206cc2a57b87116b

asset not found

I installed react-toolbox in react-redux-universal-hot-example and got this error:

[1] [webpack-isomorphic-tools] [error] asset not found: ./~/react-toolbox/lib/app/style.scss
[1] [webpack-isomorphic-tools] [error] asset not found: ./~/react-toolbox/lib/app_bar/style.scss
[1] [webpack-isomorphic-tools] [error] asset not found: ./~/react-toolbox/lib/input/style.scss
[1] [webpack-isomorphic-tools] [error] asset not found: ./~/react-toolbox/lib/font_icon/style.scss
[1] [piping] can't execute file: D:\projects\rrum\bin\server.js
[1] [piping] error given was: Error: locals[0] does not appear to be a `module` object with Hot Module replacement API enabled. You should disable react-transform-hmr in production by using `env` section in Babel configuration. See the example in README: https://github.com/gaearon/react-transform-hmr [1]     at proxyReactComponents (D:\projects\rrum\node_modules\react-transform-hmr\lib\index.js:51:11)
[1]     at Object.<anonymous> (D:\projects\rrum\node_modules\react-toolbox\lib\input\index.js:45:65)
[1]     at Module._compile (module.js:435:26)
[1]     at Module._extensions..js (module.js:442:10)
[1]     at Object.require.extensions.(anonymous function) [as .js] (D:\projects\rrum\node_modules\babel-core\lib\api\register\node.js:214:7)
[1]     at Module.load (module.js:356:32)
[1]     at Module._load (module.js:311:12)
[1]     at Function.module._load (D:\projects\rrum\node_modules\piping\lib\launcher.js:32:16)
[1]     at Module.require (module.js:366:17)
[1]     at require (module.js:385:17)

Hack require in Webpack compilation

I'm wondering if you ever discovered a way/created a plugin for Webpack to redefine requires for server compilation through Webpack. You suggested here #7 (comment) the maybe this could be done through NormalModuleReplacement plugin.

webpack-isomorphic-tools are working great for me if I pre-compile my files with Babel or use babel-register but I'm running into situations, such as on AWS Lambda, that I would prefer to make a server bundle with Webpack, then I don't have to zip all my client node_modules and upload them to Lambda.

Wondering if there is an easy way to do this?

css-modules use case

Hello,
I wanted to use your css_modules_loader_parser, and took inspiration from your pull.
https://github.com/erikras/react-redux-universal-hot-example/pull/463/files

Config

import WebpackIsomorphicToolsPlugin from 'webpack-isomorphic-tools/plugin';


// see this link for more info on what all of this means
// https://github.com/halt-hammerzeit/webpack-isomorphic-tools
const config = {
  webpack_assets_file_path: 'webpack-stats.json',

  assets: {
    images: {
      extensions: ['jpeg', 'jpg', 'png', 'gif', 'svg'],
      parser: WebpackIsomorphicToolsPlugin.url_loader_parser
    },
    fonts: {
      extensions: ['ttf', 'woff', 'woff2'],
      parser: WebpackIsomorphicToolsPlugin.url_loader_parser
    },
    svg: {
      extension: 'svg',
      parser: WebpackIsomorphicToolsPlugin.url_loader_parser
    },
    style_modules: {
      extensions: ['less', 'scss', 'sass', 'styl', 'css'],
      filter: (module, regex, options, log) => {
        if (options.development) {
          // in development mode there's webpack "style-loader",
          // so the module.name is not equal to module.name
          return WebpackIsomorphicToolsPlugin.style_loader_filter(module, regex, options, log);
        } else {
          // in production mode there's no webpack "style-loader",
          // so the module.name will be equal to the asset path
          return regex.test(module.name);
        }
      },
      path: (module, options, log) => {
        if (options.development) {
          // in development mode there's webpack "style-loader",
          // so the module.name is not equal to module.name
          return WebpackIsomorphicToolsPlugin.style_loader_path_extractor(module, options, log);
        } else {
          // in production mode there's no webpack "style-loader",
          // so the module.name will be equal to the asset path
          return module.name;
        }
      },
      // parser: WebpackIsomorphicToolsPlugin.css_loader_parser
      parser: (module, options, log) => {
        // FAIL
        // if (options.development) {
        //   return WebpackIsomorphicToolsPlugin.css_modules_loader_parser(module, options, log);
        // } else {
        //   // in production mode there's Extract Text Loader which extracts CSS text away
        //   console.log(module.source);
        //   return module.source;
        // }
        // OK
        if (module.source) {
          const regex = options.development ? /exports\.locals = ((.|\n)+);/ : /module\.exports = ((.|\n)+);/;
          const match = module.source.match(regex);
          return match ? JSON.parse(match[1]) : {};
        }
      }
    }
  }
};


export default config;

FAIL

Development:
{
  "javascript": {
    "app": "http://localhost:8082/dist/app-2a2cf7557cd6e4a3d05d.js"
  },
  "styles": {},
  "assets": {
    "./assets/index.scss": "exports = module.exports = require(\"./../node_modules/css-loader/lib/css-base.js\")();\n// imports\nexports.i(require(\"-!./../node_modules/css-loader/index.js?modules&importLoaders=2&sourceMap&localIdentName=[local]___[hash:base64:5]!./../node_modules/autoprefixer-loader/index.js?browsers=last 2 version!./../node_modules/sass-loader/index.js?outputStyle=expanded&sourceMap=true&sourceMapContents=true!normalize.css/normalize.css\"), \"\");\nexports.i(require(\"-!./../node_modules/css-loader/index.js?modules&importLoaders=2&sourceMap&localIdentName=[local]___[hash:base64:5]!./../node_modules/autoprefixer-loader/index.js?browsers=last 2 version!./../node_modules/sass-loader/index.js?outputStyle=expanded&sourceMap=true&sourceMapContents=true!basscss-base-reset/index.css\"), \"\");\n\n// module\nexports.push([module.id, \" {\\n  /**\\n   * React Select\\n   * ============\\n   * Created by Jed Watson and Joss Mackison for KeystoneJS, http://www.keystonejs.com/\\n   * https://twitter.com/jedwatson https://twitter.com/jossmackison https://twitter.com/keystonejs\\n   * MIT License: https://github.com/keystonejs/react-select\\n  */\\n}\\n\\n.Select {\\n  position: relative;\\n}\\n\\n.Select,\\n.Select div,\\n.Select input,\\n.Select span {\\n  box-sizing: border-box;\\n}\\n\\n.Select.is-disabled > .Select-control {\\n  background-color: #f6f6f6;\\n}\\n\\n.Select.is-disabled .Select-arrow-zone {\\n  cursor: default;\\n  pointer-events: none;\\n}\\n\\n.Select-control {\\n  background-color: #fff;\\n  border-color: #d9d9d9 #ccc #b3b3b3;\\n  border-radius: 4px;\\n  border: 1px solid #ccc;\\n  color: #333;\\n  cursor: default;\\n  display: table;\\n  height: 36px;\\n  outline: none;\\n  overflow: hidden;\\n  position: relative;\\n  width: 100%;\\n}\\n\\n.Select-control:hover {\\n  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);\\n}\\n\\n.is-searchable.is-open > .Select-control {\\n  cursor: text;\\n}\\n\\n.is-open > .Select-control {\\n  border-bottom-right-radius: 0;\\n  border-bottom-left-radius: 0;\\n  background: #fff;\\n  border-color: #b3b3b3 #ccc #d9d9d9;\\n}\\n\\n.is-open > .Select-control > .Select-arrow {\\n  border-color: transparent transparent #999;\\n  border-width: 0 5px 5px;\\n}\\n\\n.is-searchable.is-focused:not(.is-open) > .Select-control {\\n  cursor: text;\\n}\\n\\n.is-focused:not(.is-open) > .Select-control {\\n  border-color: #08c #0099e6 #0099e6;\\n  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 0 5px -1px rgba(0, 136, 204, 0.5);\\n}\\n\\n.Select-placeholder {\\n  bottom: 0;\\n  color: #aaa;\\n  left: 0;\\n  line-height: 34px;\\n  padding-left: 10px;\\n  padding-right: 10px;\\n  position: absolute;\\n  right: 0;\\n  top: 0;\\n  max-width: 100%;\\n  overflow: hidden;\\n  text-overflow: ellipsis;\\n  white-space: nowrap;\\n}\\n\\n.has-value > .Select-control > .Select-placeholder {\\n  color: #333;\\n}\\n\\n.Select-value {\\n  color: #aaa;\\n  left: 0;\\n  padding: 8px 52px 8px 10px;\\n  position: absolute;\\n  right: -15px;\\n  top: 0;\\n  max-width: 100%;\\n  overflow: hidden;\\n  text-overflow: ellipsis;\\n  white-space: nowrap;\\n}\\n\\n.has-value > .Select-control > .Select-value {\\n  color: #333;\\n}\\n\\n.Select-input {\\n  height: 34px;\\n  padding-left: 10px;\\n  padding-right: 10px;\\n  vertical-align: middle;\\n}\\n\\n.Select-input > input {\\n  background: none transparent;\\n  border: 0 none;\\n  box-shadow: none;\\n  cursor: default;\\n  display: inline-block;\\n  font-family: inherit;\\n  font-size: inherit;\\n  height: 34px;\\n  margin: 0;\\n  outline: none;\\n  padding: 0;\\n  -webkit-appearance: none;\\n}\\n\\n.is-focused .Select-input > input {\\n  cursor: text;\\n}\\n\\n.Select-control:not(.is-searchable) > .Select-input {\\n  outline: none;\\n}\\n\\n.Select-loading-zone {\\n  cursor: pointer;\\n  display: table-cell;\\n  position: relative;\\n  text-align: center;\\n  vertical-align: middle;\\n  width: 16px;\\n}\\n\\n.Select-loading {\\n  -webkit-animation: Select-animation-spin 400ms infinite linear;\\n  animation: Select-animation-spin 400ms infinite linear;\\n  width: 16px;\\n  height: 16px;\\n  box-sizing: border-box;\\n  border-radius: 50%;\\n  border: 2px solid #ccc;\\n  border-right-color: #333;\\n  display: inline-block;\\n  position: relative;\\n  vertical-align: middle;\\n}\\n\\n.Select-clear-zone {\\n  -webkit-animation: Select-animation-fadeIn 200ms;\\n  animation: Select-animation-fadeIn 200ms;\\n  color: #999;\\n  cursor: pointer;\\n  display: table-cell;\\n  position: relative;\\n  text-align: center;\\n  vertical-align: middle;\\n  width: 17px;\\n}\\n\\n.Select-clear-zone:hover {\\n  color: #D0021B;\\n}\\n\\n.Select-clear {\\n  display: inline-block;\\n  font-size: 18px;\\n  line-height: 1;\\n}\\n\\n.Select--multi .Select-clear-zone {\\n  width: 17px;\\n}\\n\\n.Select-arrow-zone {\\n  cursor: pointer;\\n  display: table-cell;\\n  position: relative;\\n  text-align: center;\\n  vertical-align: middle;\\n  width: 25px;\\n  padding-right: 5px;\\n}\\n\\n.Select-arrow {\\n  border-color: #999 transparent transparent;\\n  border-style: solid;\\n  border-width: 5px 5px 2.5px;\\n  display: inline-block;\\n  height: 0;\\n  width: 0;\\n}\\n\\n.is-open .Select-arrow,\\n.Select-arrow-zone:hover > .Select-arrow {\\n  border-top-color: #666;\\n}\\n\\n.Select-menu-outer {\\n  border-bottom-right-radius: 4px;\\n  border-bottom-left-radius: 4px;\\n  background-color: #fff;\\n  border: 1px solid #ccc;\\n  border-top-color: #e6e6e6;\\n  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);\\n  box-sizing: border-box;\\n  margin-top: -1px;\\n  max-height: 200px;\\n  position: absolute;\\n  top: 100%;\\n  width: 100%;\\n  z-index: 1000;\\n  -webkit-overflow-scrolling: touch;\\n}\\n\\n.Select-menu {\\n  max-height: 198px;\\n  overflow-y: auto;\\n}\\n\\n.Select-option {\\n  box-sizing: border-box;\\n  color: #666666;\\n  cursor: pointer;\\n  display: block;\\n  padding: 8px 10px;\\n}\\n\\n.Select-option:last-child {\\n  border-bottom-right-radius: 4px;\\n  border-bottom-left-radius: 4px;\\n}\\n\\n.Select-option.is-focused {\\n  background-color: #f2f9fc;\\n  color: #333;\\n}\\n\\n.Select-option.is-disabled {\\n  color: #cccccc;\\n  cursor: not-allowed;\\n}\\n\\n.Select-noresults,\\n.Select-search-prompt,\\n.Select-searching {\\n  box-sizing: border-box;\\n  color: #999999;\\n  cursor: default;\\n  display: block;\\n  padding: 8px 10px;\\n}\\n\\n.Select--multi .Select-input {\\n  vertical-align: middle;\\n  margin-left: 10px;\\n  padding: 0;\\n}\\n\\n.Select--multi.has-value .Select-input {\\n  margin-left: 5px;\\n}\\n\\n.Select-item {\\n  background-color: #f2f9fc;\\n  border-radius: 2px;\\n  border: 1px solid #c9e6f2;\\n  color: #08c;\\n  display: inline-block;\\n  font-size: 0.9em;\\n  margin-left: 5px;\\n  margin-top: 5px;\\n  vertical-align: top;\\n}\\n\\n.Select-item-icon,\\n.Select-item-label {\\n  display: inline-block;\\n  vertical-align: middle;\\n}\\n\\n.Select-item-label {\\n  border-bottom-right-radius: 2px;\\n  border-top-right-radius: 2px;\\n  cursor: default;\\n  padding: 2px 5px;\\n}\\n\\n.Select-item-label .Select-item-label__a {\\n  color: #08c;\\n  cursor: pointer;\\n}\\n\\n.Select-item-icon {\\n  cursor: pointer;\\n  border-bottom-left-radius: 2px;\\n  border-top-left-radius: 2px;\\n  border-right: 1px solid #c9e6f2;\\n  padding: 1px 5px 3px;\\n}\\n\\n.Select-item-icon:hover,\\n.Select-item-icon:focus {\\n  background-color: #ddeff7;\\n  color: #0077b3;\\n}\\n\\n.Select-item-icon:active {\\n  background-color: #c9e6f2;\\n}\\n\\n.Select--multi.is-disabled .Select-item {\\n  background-color: #f2f2f2;\\n  border: 1px solid #d9d9d9;\\n  color: #888;\\n}\\n\\n.Select--multi.is-disabled .Select-item-icon {\\n  cursor: not-allowed;\\n  border-right: 1px solid #d9d9d9;\\n}\\n\\n.Select--multi.is-disabled .Select-item-icon:hover,\\n.Select--multi.is-disabled .Select-item-icon:focus,\\n.Select--multi.is-disabled .Select-item-icon:active {\\n  background-color: #f2f2f2;\\n}\\n\\n@-webkit-keyframes Select-animation-fadeIn {\\n  from {\\n    opacity: 0;\\n  }\\n  to {\\n    opacity: 1;\\n  }\\n}\\n\\n@keyframes Select-animation-fadeIn {\\n  from {\\n    opacity: 0;\\n  }\\n  to {\\n    opacity: 1;\\n  }\\n}\\n\\n@keyframes Select-animation-spin {\\n  to {\\n    -webkit-transform: rotate(1turn);\\n            transform: rotate(1turn);\\n  }\\n}\\n\\n@-webkit-keyframes Select-animation-spin {\\n  to {\\n    -webkit-transform: rotate(1turn);\\n  }\\n}\\n\\nbody {\\n  background-color: #FFFFFF;\\n}\\n\", \"\", {\"version\":3,\"sources\":[\"/./assets/assets/styles/Select.scss\",\"/./assets/assets/index.scss\",\"/./assets/assets/index.scss\"],\"names\":[],\"mappings\":\"AAAA;EACE;;;;;;IAME;CAqSH;;AA5SD;EASI,mBAAmB;CACpB;;AAVH;;;;EAiBI,uBAAuB;CACxB;;AAlBH;EAoBI,0BAA0B;CAC3B;;AArBH;EAuBI,gBAAgB;EAChB,qBAAqB;CACtB;;AAzBH;EA2BI,uBAAuB;EACvB,mCAAmC;EACnC,mBAAmB;EACnB,uBAAuB;EACvB,YAAY;EACZ,gBAAgB;EAChB,eAAe;EACf,aAAa;EACb,cAAc;EACd,iBAAiB;EACjB,mBAAmB;EACnB,YAAY;CACb;;AAvCH;EAyCI,wCAAwB;CACzB;;AA1CH;EA4CI,aAAa;CACd;;AA7CH;EA+CI,8BAA8B;EAC9B,6BAA6B;EAC7B,iBAAiB;EACjB,mCAAmC;CACpC;;AAnDH;EAqDI,2CAA2C;EAC3C,wBAAwB;CACzB;;AAvDH;EAyDI,aAAa;CACd;;AA1DH;EA4DI,mCAAmC;EACnC,oFAAiE;CAClE;;AA9DH;EAgEI,UAAU;EACV,YAAY;EACZ,QAAQ;EACR,kBAAkB;EAClB,mBAAmB;EACnB,oBAAoB;EACpB,mBAAmB;EACnB,SAAS;EACT,OAAO;EACP,gBAAgB;EAChB,iBAAiB;EACjB,wBAAwB;EACxB,oBAAoB;CACrB;;AA7EH;EA+EI,YAAY;CACb;;AAhFH;EAkFI,YAAY;EACZ,QAAQ;EACR,2BAA2B;EAC3B,mBAAmB;EACnB,aAAa;EACb,OAAO;EACP,gBAAgB;EAChB,iBAAiB;EACjB,wBAAwB;EACxB,oBAAoB;CACrB;;AA5FH;EA8FI,YAAY;CACb;;AA/FH;EAiGI,aAAa;EACb,mBAAmB;EACnB,oBAAoB;EACpB,uBAAuB;CACxB;;AArGH;EAuGI,6BAA6B;EAC7B,eAAe;EACf,iBAAiB;EACjB,gBAAgB;EAChB,sBAAsB;EACtB,qBAAqB;EACrB,mBAAmB;EACnB,aAAa;EACb,UAAU;EACV,cAAc;EACd,WAAW;EACX,yBAAyB;CAC1B;;AAnHH;EAqHI,aAAa;CACd;;AAtHH;EAwHI,cAAc;CACf;;AAzHH;EA2HI,gBAAgB;EAChB,oBAAoB;EACpB,mBAAmB;EACnB,mBAAmB;EACnB,uBAAuB;EACvB,YAAY;CACb;;AAjIH;EAmII,+DAA+D;EAE/D,uDAAuD;EACvD,YAAY;EACZ,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,uBAAuB;EACvB,yBAAyB;EACzB,sBAAsB;EACtB,mBAAmB;EACnB,uBAAuB;CACxB;;AA/IH;EAiJI,iDAAiD;EAEjD,yCAAyC;EACzC,YAAY;EACZ,gBAAgB;EAChB,oBAAoB;EACpB,mBAAmB;EACnB,mBAAmB;EACnB,uBAAuB;EACvB,YAAY;CACb;;AA3JH;EA6JI,eAAe;CAChB;;AA9JH;EAgKI,sBAAsB;EACtB,gBAAgB;EAChB,eAAe;CAChB;;AAnKH;EAqKI,YAAY;CACb;;AAtKH;EAwKI,gBAAgB;EAChB,oBAAoB;EACpB,mBAAmB;EACnB,mBAAmB;EACnB,uBAAuB;EACvB,YAAY;EACZ,mBAAmB;CACpB;;AA/KH;EAiLI,2CAA2C;EAC3C,oBAAoB;EACpB,4BAA4B;EAC5B,sBAAsB;EACtB,UAAU;EACV,SAAS;CACV;;AAvLH;;EA0LI,uBAAuB;CACxB;;AA3LH;EA6LI,gCAAgC;EAChC,+BAA+B;EAC/B,uBAAuB;EACvB,uBAAuB;EACvB,0BAA0B;EAC1B,wCAAwB;EACxB,uBAAuB;EACvB,iBAAiB;EACjB,kBAAkB;EAClB,mBAAmB;EACnB,UAAU;EACV,YAAY;EACZ,cAAc;EACd,kCAAkC;CACnC;;AA3MH;EA6MI,kBAAkB;EAClB,iBAAiB;CAClB;;AA/MH;EAiNI,uBAAuB;EACvB,eAAe;EACf,gBAAgB;EAChB,eAAe;EACf,kBAAkB;CACnB;;AAtNH;EAwNI,gCAAgC;EAChC,+BAA+B;CAChC;;AA1NH;EA4NI,0BAA0B;EAC1B,YAAY;CACb;;AA9NH;EAgOI,eAAe;EACf,oBAAoB;CACrB;;AAlOH;;;EAsOI,uBAAuB;EACvB,eAAe;EACf,gBAAgB;EAChB,eAAe;EACf,kBAAkB;CACnB;;AA3OH;EA6OI,uBAAuB;EACvB,kBAAkB;EAClB,WAAW;CACZ;;AAhPH;EAkPI,iBAAiB;CAClB;;AAnPH;EAqPI,0BAA0B;EAC1B,mBAAmB;EACnB,0BAA0B;EAC1B,YAAY;EACZ,sBAAsB;EACtB,iBAAiB;EACjB,iBAAiB;EACjB,gBAAgB;EAChB,oBAAoB;CACrB;;AA9PH;;EAiQI,sBAAsB;EACtB,uBAAuB;CACxB;;AAnQH;EAqQI,gCAAgC;EAChC,6BAA6B;EAC7B,gBAAgB;EAChB,iBAAiB;CAClB;;AAzQH;EA2QI,YAAY;EACZ,gBAAgB;CACjB;;AA7QH;EA+QI,gBAAgB;EAChB,+BAA+B;EAC/B,4BAA4B;EAC5B,gCAAgC;EAChC,qBAAqB;CACtB;;AApRH;;EAuRI,0BAA0B;EAC1B,eAAe;CAChB;;AAzRH;EA2RI,0BAA0B;CAC3B;;AA5RH;EA8RI,0BAA0B;EAC1B,0BAA0B;EAC1B,YAAY;CACb;;AAjSH;EAmSI,oBAAoB;EACpB,gCAAgC;CACjC;;AArSH;;;EAySI,0BAA0B;CAC3B;;AAIH;EACE;IACE,WAAW;GCiDZ;ED/CD;IACE,WAAW;GCiDZ;CACF;;AD/CD;EACE;IACE,WAAW;GCkDZ;EDhDD;IACE,WAAW;GCkDZ;CACF;;ADhDD;EACE;IACE,iCAAiB;YAAjB,yBAAiB;GCmDlB;CACF;;ADjDD;EACE;IACE,iCAAyB;GCoD1B;CACF;;ACpXD;EAEI,0BAA0B;CAC3B\",\"file\":\"index.scss\",\"sourcesContent\":[\":global {\\n  /**\\n   * React Select\\n   * ============\\n   * Created by Jed Watson and Joss Mackison for KeystoneJS, http://www.keystonejs.com/\\n   * https://twitter.com/jedwatson https://twitter.com/jossmackison https://twitter.com/keystonejs\\n   * MIT License: https://github.com/keystonejs/react-select\\n  */\\n  .Select {\\n    position: relative;\\n  }\\n  .Select,\\n  .Select div,\\n  .Select input,\\n  .Select span {\\n    -webkit-box-sizing: border-box;\\n    -moz-box-sizing: border-box;\\n    box-sizing: border-box;\\n  }\\n  .Select.is-disabled > .Select-control {\\n    background-color: #f6f6f6;\\n  }\\n  .Select.is-disabled .Select-arrow-zone {\\n    cursor: default;\\n    pointer-events: none;\\n  }\\n  .Select-control {\\n    background-color: #fff;\\n    border-color: #d9d9d9 #ccc #b3b3b3;\\n    border-radius: 4px;\\n    border: 1px solid #ccc;\\n    color: #333;\\n    cursor: default;\\n    display: table;\\n    height: 36px;\\n    outline: none;\\n    overflow: hidden;\\n    position: relative;\\n    width: 100%;\\n  }\\n  .Select-control:hover {\\n    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);\\n  }\\n  .is-searchable.is-open > .Select-control {\\n    cursor: text;\\n  }\\n  .is-open > .Select-control {\\n    border-bottom-right-radius: 0;\\n    border-bottom-left-radius: 0;\\n    background: #fff;\\n    border-color: #b3b3b3 #ccc #d9d9d9;\\n  }\\n  .is-open > .Select-control > .Select-arrow {\\n    border-color: transparent transparent #999;\\n    border-width: 0 5px 5px;\\n  }\\n  .is-searchable.is-focused:not(.is-open) > .Select-control {\\n    cursor: text;\\n  }\\n  .is-focused:not(.is-open) > .Select-control {\\n    border-color: #08c #0099e6 #0099e6;\\n    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 0 5px -1px rgba(0, 136, 204, 0.5);\\n  }\\n  .Select-placeholder {\\n    bottom: 0;\\n    color: #aaa;\\n    left: 0;\\n    line-height: 34px;\\n    padding-left: 10px;\\n    padding-right: 10px;\\n    position: absolute;\\n    right: 0;\\n    top: 0;\\n    max-width: 100%;\\n    overflow: hidden;\\n    text-overflow: ellipsis;\\n    white-space: nowrap;\\n  }\\n  .has-value > .Select-control > .Select-placeholder {\\n    color: #333;\\n  }\\n  .Select-value {\\n    color: #aaa;\\n    left: 0;\\n    padding: 8px 52px 8px 10px;\\n    position: absolute;\\n    right: -15px;\\n    top: 0;\\n    max-width: 100%;\\n    overflow: hidden;\\n    text-overflow: ellipsis;\\n    white-space: nowrap;\\n  }\\n  .has-value > .Select-control > .Select-value {\\n    color: #333;\\n  }\\n  .Select-input {\\n    height: 34px;\\n    padding-left: 10px;\\n    padding-right: 10px;\\n    vertical-align: middle;\\n  }\\n  .Select-input > input {\\n    background: none transparent;\\n    border: 0 none;\\n    box-shadow: none;\\n    cursor: default;\\n    display: inline-block;\\n    font-family: inherit;\\n    font-size: inherit;\\n    height: 34px;\\n    margin: 0;\\n    outline: none;\\n    padding: 0;\\n    -webkit-appearance: none;\\n  }\\n  .is-focused .Select-input > input {\\n    cursor: text;\\n  }\\n  .Select-control:not(.is-searchable) > .Select-input {\\n    outline: none;\\n  }\\n  .Select-loading-zone {\\n    cursor: pointer;\\n    display: table-cell;\\n    position: relative;\\n    text-align: center;\\n    vertical-align: middle;\\n    width: 16px;\\n  }\\n  .Select-loading {\\n    -webkit-animation: Select-animation-spin 400ms infinite linear;\\n    -o-animation: Select-animation-spin 400ms infinite linear;\\n    animation: Select-animation-spin 400ms infinite linear;\\n    width: 16px;\\n    height: 16px;\\n    box-sizing: border-box;\\n    border-radius: 50%;\\n    border: 2px solid #ccc;\\n    border-right-color: #333;\\n    display: inline-block;\\n    position: relative;\\n    vertical-align: middle;\\n  }\\n  .Select-clear-zone {\\n    -webkit-animation: Select-animation-fadeIn 200ms;\\n    -o-animation: Select-animation-fadeIn 200ms;\\n    animation: Select-animation-fadeIn 200ms;\\n    color: #999;\\n    cursor: pointer;\\n    display: table-cell;\\n    position: relative;\\n    text-align: center;\\n    vertical-align: middle;\\n    width: 17px;\\n  }\\n  .Select-clear-zone:hover {\\n    color: #D0021B;\\n  }\\n  .Select-clear {\\n    display: inline-block;\\n    font-size: 18px;\\n    line-height: 1;\\n  }\\n  .Select--multi .Select-clear-zone {\\n    width: 17px;\\n  }\\n  .Select-arrow-zone {\\n    cursor: pointer;\\n    display: table-cell;\\n    position: relative;\\n    text-align: center;\\n    vertical-align: middle;\\n    width: 25px;\\n    padding-right: 5px;\\n  }\\n  .Select-arrow {\\n    border-color: #999 transparent transparent;\\n    border-style: solid;\\n    border-width: 5px 5px 2.5px;\\n    display: inline-block;\\n    height: 0;\\n    width: 0;\\n  }\\n  .is-open .Select-arrow,\\n  .Select-arrow-zone:hover > .Select-arrow {\\n    border-top-color: #666;\\n  }\\n  .Select-menu-outer {\\n    border-bottom-right-radius: 4px;\\n    border-bottom-left-radius: 4px;\\n    background-color: #fff;\\n    border: 1px solid #ccc;\\n    border-top-color: #e6e6e6;\\n    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);\\n    box-sizing: border-box;\\n    margin-top: -1px;\\n    max-height: 200px;\\n    position: absolute;\\n    top: 100%;\\n    width: 100%;\\n    z-index: 1000;\\n    -webkit-overflow-scrolling: touch;\\n  }\\n  .Select-menu {\\n    max-height: 198px;\\n    overflow-y: auto;\\n  }\\n  .Select-option {\\n    box-sizing: border-box;\\n    color: #666666;\\n    cursor: pointer;\\n    display: block;\\n    padding: 8px 10px;\\n  }\\n  .Select-option:last-child {\\n    border-bottom-right-radius: 4px;\\n    border-bottom-left-radius: 4px;\\n  }\\n  .Select-option.is-focused {\\n    background-color: #f2f9fc;\\n    color: #333;\\n  }\\n  .Select-option.is-disabled {\\n    color: #cccccc;\\n    cursor: not-allowed;\\n  }\\n  .Select-noresults,\\n  .Select-search-prompt,\\n  .Select-searching {\\n    box-sizing: border-box;\\n    color: #999999;\\n    cursor: default;\\n    display: block;\\n    padding: 8px 10px;\\n  }\\n  .Select--multi .Select-input {\\n    vertical-align: middle;\\n    margin-left: 10px;\\n    padding: 0;\\n  }\\n  .Select--multi.has-value .Select-input {\\n    margin-left: 5px;\\n  }\\n  .Select-item {\\n    background-color: #f2f9fc;\\n    border-radius: 2px;\\n    border: 1px solid #c9e6f2;\\n    color: #08c;\\n    display: inline-block;\\n    font-size: 0.9em;\\n    margin-left: 5px;\\n    margin-top: 5px;\\n    vertical-align: top;\\n  }\\n  .Select-item-icon,\\n  .Select-item-label {\\n    display: inline-block;\\n    vertical-align: middle;\\n  }\\n  .Select-item-label {\\n    border-bottom-right-radius: 2px;\\n    border-top-right-radius: 2px;\\n    cursor: default;\\n    padding: 2px 5px;\\n  }\\n  .Select-item-label .Select-item-label__a {\\n    color: #08c;\\n    cursor: pointer;\\n  }\\n  .Select-item-icon {\\n    cursor: pointer;\\n    border-bottom-left-radius: 2px;\\n    border-top-left-radius: 2px;\\n    border-right: 1px solid #c9e6f2;\\n    padding: 1px 5px 3px;\\n  }\\n  .Select-item-icon:hover,\\n  .Select-item-icon:focus {\\n    background-color: #ddeff7;\\n    color: #0077b3;\\n  }\\n  .Select-item-icon:active {\\n    background-color: #c9e6f2;\\n  }\\n  .Select--multi.is-disabled .Select-item {\\n    background-color: #f2f2f2;\\n    border: 1px solid #d9d9d9;\\n    color: #888;\\n  }\\n  .Select--multi.is-disabled .Select-item-icon {\\n    cursor: not-allowed;\\n    border-right: 1px solid #d9d9d9;\\n  }\\n  .Select--multi.is-disabled .Select-item-icon:hover,\\n  .Select--multi.is-disabled .Select-item-icon:focus,\\n  .Select--multi.is-disabled .Select-item-icon:active {\\n    background-color: #f2f2f2;\\n  }\\n\\n}\\n\\n@-webkit-keyframes :global(Select-animation-fadeIn) {\\n  from {\\n    opacity: 0;\\n  }\\n  to {\\n    opacity: 1;\\n  }\\n}\\n@keyframes :global(Select-animation-fadeIn) {\\n  from {\\n    opacity: 0;\\n  }\\n  to {\\n    opacity: 1;\\n  }\\n}\\n@keyframes :global(Select-animation-spin) {\\n  to {\\n    transform: rotate(1turn);\\n  }\\n}\\n@-webkit-keyframes :global(Select-animation-spin) {\\n  to {\\n    -webkit-transform: rotate(1turn);\\n  }\\n}\\n\",\"@import url(normalize.css/normalize.css);\\n@import url(basscss-base-reset/index.css);\\n:global {\\n  /**\\n   * React Select\\n   * ============\\n   * Created by Jed Watson and Joss Mackison for KeystoneJS, http://www.keystonejs.com/\\n   * https://twitter.com/jedwatson https://twitter.com/jossmackison https://twitter.com/keystonejs\\n   * MIT License: https://github.com/keystonejs/react-select\\n  */\\n}\\n\\n:global .Select {\\n  position: relative;\\n}\\n\\n:global .Select,\\n:global .Select div,\\n:global .Select input,\\n:global .Select span {\\n  -webkit-box-sizing: border-box;\\n  -moz-box-sizing: border-box;\\n  box-sizing: border-box;\\n}\\n\\n:global .Select.is-disabled > .Select-control {\\n  background-color: #f6f6f6;\\n}\\n\\n:global .Select.is-disabled .Select-arrow-zone {\\n  cursor: default;\\n  pointer-events: none;\\n}\\n\\n:global .Select-control {\\n  background-color: #fff;\\n  border-color: #d9d9d9 #ccc #b3b3b3;\\n  border-radius: 4px;\\n  border: 1px solid #ccc;\\n  color: #333;\\n  cursor: default;\\n  display: table;\\n  height: 36px;\\n  outline: none;\\n  overflow: hidden;\\n  position: relative;\\n  width: 100%;\\n}\\n\\n:global .Select-control:hover {\\n  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);\\n}\\n\\n:global .is-searchable.is-open > .Select-control {\\n  cursor: text;\\n}\\n\\n:global .is-open > .Select-control {\\n  border-bottom-right-radius: 0;\\n  border-bottom-left-radius: 0;\\n  background: #fff;\\n  border-color: #b3b3b3 #ccc #d9d9d9;\\n}\\n\\n:global .is-open > .Select-control > .Select-arrow {\\n  border-color: transparent transparent #999;\\n  border-width: 0 5px 5px;\\n}\\n\\n:global .is-searchable.is-focused:not(.is-open) > .Select-control {\\n  cursor: text;\\n}\\n\\n:global .is-focused:not(.is-open) > .Select-control {\\n  border-color: #08c #0099e6 #0099e6;\\n  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 0 5px -1px rgba(0, 136, 204, 0.5);\\n}\\n\\n:global .Select-placeholder {\\n  bottom: 0;\\n  color: #aaa;\\n  left: 0;\\n  line-height: 34px;\\n  padding-left: 10px;\\n  padding-right: 10px;\\n  position: absolute;\\n  right: 0;\\n  top: 0;\\n  max-width: 100%;\\n  overflow: hidden;\\n  text-overflow: ellipsis;\\n  white-space: nowrap;\\n}\\n\\n:global .has-value > .Select-control > .Select-placeholder {\\n  color: #333;\\n}\\n\\n:global .Select-value {\\n  color: #aaa;\\n  left: 0;\\n  padding: 8px 52px 8px 10px;\\n  position: absolute;\\n  right: -15px;\\n  top: 0;\\n  max-width: 100%;\\n  overflow: hidden;\\n  text-overflow: ellipsis;\\n  white-space: nowrap;\\n}\\n\\n:global .has-value > .Select-control > .Select-value {\\n  color: #333;\\n}\\n\\n:global .Select-input {\\n  height: 34px;\\n  padding-left: 10px;\\n  padding-right: 10px;\\n  vertical-align: middle;\\n}\\n\\n:global .Select-input > input {\\n  background: none transparent;\\n  border: 0 none;\\n  box-shadow: none;\\n  cursor: default;\\n  display: inline-block;\\n  font-family: inherit;\\n  font-size: inherit;\\n  height: 34px;\\n  margin: 0;\\n  outline: none;\\n  padding: 0;\\n  -webkit-appearance: none;\\n}\\n\\n:global .is-focused .Select-input > input {\\n  cursor: text;\\n}\\n\\n:global .Select-control:not(.is-searchable) > .Select-input {\\n  outline: none;\\n}\\n\\n:global .Select-loading-zone {\\n  cursor: pointer;\\n  display: table-cell;\\n  position: relative;\\n  text-align: center;\\n  vertical-align: middle;\\n  width: 16px;\\n}\\n\\n:global .Select-loading {\\n  -webkit-animation: Select-animation-spin 400ms infinite linear;\\n  -o-animation: Select-animation-spin 400ms infinite linear;\\n  animation: Select-animation-spin 400ms infinite linear;\\n  width: 16px;\\n  height: 16px;\\n  box-sizing: border-box;\\n  border-radius: 50%;\\n  border: 2px solid #ccc;\\n  border-right-color: #333;\\n  display: inline-block;\\n  position: relative;\\n  vertical-align: middle;\\n}\\n\\n:global .Select-clear-zone {\\n  -webkit-animation: Select-animation-fadeIn 200ms;\\n  -o-animation: Select-animation-fadeIn 200ms;\\n  animation: Select-animation-fadeIn 200ms;\\n  color: #999;\\n  cursor: pointer;\\n  display: table-cell;\\n  position: relative;\\n  text-align: center;\\n  vertical-align: middle;\\n  width: 17px;\\n}\\n\\n:global .Select-clear-zone:hover {\\n  color: #D0021B;\\n}\\n\\n:global .Select-clear {\\n  display: inline-block;\\n  font-size: 18px;\\n  line-height: 1;\\n}\\n\\n:global .Select--multi .Select-clear-zone {\\n  width: 17px;\\n}\\n\\n:global .Select-arrow-zone {\\n  cursor: pointer;\\n  display: table-cell;\\n  position: relative;\\n  text-align: center;\\n  vertical-align: middle;\\n  width: 25px;\\n  padding-right: 5px;\\n}\\n\\n:global .Select-arrow {\\n  border-color: #999 transparent transparent;\\n  border-style: solid;\\n  border-width: 5px 5px 2.5px;\\n  display: inline-block;\\n  height: 0;\\n  width: 0;\\n}\\n\\n:global .is-open .Select-arrow,\\n:global .Select-arrow-zone:hover > .Select-arrow {\\n  border-top-color: #666;\\n}\\n\\n:global .Select-menu-outer {\\n  border-bottom-right-radius: 4px;\\n  border-bottom-left-radius: 4px;\\n  background-color: #fff;\\n  border: 1px solid #ccc;\\n  border-top-color: #e6e6e6;\\n  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);\\n  box-sizing: border-box;\\n  margin-top: -1px;\\n  max-height: 200px;\\n  position: absolute;\\n  top: 100%;\\n  width: 100%;\\n  z-index: 1000;\\n  -webkit-overflow-scrolling: touch;\\n}\\n\\n:global .Select-menu {\\n  max-height: 198px;\\n  overflow-y: auto;\\n}\\n\\n:global .Select-option {\\n  box-sizing: border-box;\\n  color: #666666;\\n  cursor: pointer;\\n  display: block;\\n  padding: 8px 10px;\\n}\\n\\n:global .Select-option:last-child {\\n  border-bottom-right-radius: 4px;\\n  border-bottom-left-radius: 4px;\\n}\\n\\n:global .Select-option.is-focused {\\n  background-color: #f2f9fc;\\n  color: #333;\\n}\\n\\n:global .Select-option.is-disabled {\\n  color: #cccccc;\\n  cursor: not-allowed;\\n}\\n\\n:global .Select-noresults,\\n:global .Select-search-prompt,\\n:global .Select-searching {\\n  box-sizing: border-box;\\n  color: #999999;\\n  cursor: default;\\n  display: block;\\n  padding: 8px 10px;\\n}\\n\\n:global .Select--multi .Select-input {\\n  vertical-align: middle;\\n  margin-left: 10px;\\n  padding: 0;\\n}\\n\\n:global .Select--multi.has-value .Select-input {\\n  margin-left: 5px;\\n}\\n\\n:global .Select-item {\\n  background-color: #f2f9fc;\\n  border-radius: 2px;\\n  border: 1px solid #c9e6f2;\\n  color: #08c;\\n  display: inline-block;\\n  font-size: 0.9em;\\n  margin-left: 5px;\\n  margin-top: 5px;\\n  vertical-align: top;\\n}\\n\\n:global .Select-item-icon,\\n:global .Select-item-label {\\n  display: inline-block;\\n  vertical-align: middle;\\n}\\n\\n:global .Select-item-label {\\n  border-bottom-right-radius: 2px;\\n  border-top-right-radius: 2px;\\n  cursor: default;\\n  padding: 2px 5px;\\n}\\n\\n:global .Select-item-label .Select-item-label__a {\\n  color: #08c;\\n  cursor: pointer;\\n}\\n\\n:global .Select-item-icon {\\n  cursor: pointer;\\n  border-bottom-left-radius: 2px;\\n  border-top-left-radius: 2px;\\n  border-right: 1px solid #c9e6f2;\\n  padding: 1px 5px 3px;\\n}\\n\\n:global .Select-item-icon:hover,\\n:global .Select-item-icon:focus {\\n  background-color: #ddeff7;\\n  color: #0077b3;\\n}\\n\\n:global .Select-item-icon:active {\\n  background-color: #c9e6f2;\\n}\\n\\n:global .Select--multi.is-disabled .Select-item {\\n  background-color: #f2f2f2;\\n  border: 1px solid #d9d9d9;\\n  color: #888;\\n}\\n\\n:global .Select--multi.is-disabled .Select-item-icon {\\n  cursor: not-allowed;\\n  border-right: 1px solid #d9d9d9;\\n}\\n\\n:global .Select--multi.is-disabled .Select-item-icon:hover,\\n:global .Select--multi.is-disabled .Select-item-icon:focus,\\n:global .Select--multi.is-disabled .Select-item-icon:active {\\n  background-color: #f2f2f2;\\n}\\n\\n@-webkit-keyframes :global(Select-animation-fadeIn) {\\n  from {\\n    opacity: 0;\\n  }\\n  to {\\n    opacity: 1;\\n  }\\n}\\n\\n@keyframes :global(Select-animation-fadeIn) {\\n  from {\\n    opacity: 0;\\n  }\\n  to {\\n    opacity: 1;\\n  }\\n}\\n\\n@keyframes :global(Select-animation-spin) {\\n  to {\\n    transform: rotate(1turn);\\n  }\\n}\\n\\n@-webkit-keyframes :global(Select-animation-spin) {\\n  to {\\n    -webkit-transform: rotate(1turn);\\n  }\\n}\\n\\n:global body {\\n  background-color: #FFFFFF;\\n}\\n\",\"@import 'normalize.css/normalize.css';\\n@import 'basscss-base-reset/index.css';\\n// @import 'basscss/css/basscss.css';\\n\\n@import './styles/Select.scss';\\n\\n:global {\\n  body {\\n    background-color: #FFFFFF;\\n  }\\n}\\n\"],\"sourceRoot\":\"webpack://\"}]);\n\n// exports\n; module.exports = exports.locals; module.exports._style = exports.toString()",
    "./src/common/pages/App/App.scss": "exports = module.exports = require(\"./../../../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \".content___HT6CO {\\n  margin: 50px 0;\\n}\\n\", \"\", {\"version\":3,\"sources\":[\"/./src/common/pages/App/src/common/pages/src/common/pages/App/App.scss\"],\"names\":[],\"mappings\":\"AAAA;EACE,eAAe;CAChB\",\"file\":\"App.scss\",\"sourcesContent\":[\".content {\\n  margin: 50px 0; // for fixed navbar\\n}\\n\"],\"sourceRoot\":\"webpack://\"}]);\n\n// exports\nexports.locals = {\n\t\"content\": \"content___HT6CO\"\n};; module.exports = exports.locals; module.exports._style = exports.toString()",
    "./~/basscss-base-reset/index.css": "exports = module.exports = require(\"./../css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \"body {\\n  margin: 0;\\n}\\n\\nimg {\\n  max-width: 100%;\\n}\\n\\nsvg {\\n  max-height: 100%;\\n}\\n\", \"\", {\"version\":3,\"sources\":[\"/./node_modules/basscss-base-reset/node_modules/node_modules/basscss-base-reset/index.css\"],\"names\":[],\"mappings\":\"AACA;EAAO,UAAW;CAAE;;AACpB;EAAM,gBAAiB;CAAE;;AACzB;EAAM,iBAAkB;CAAE\",\"file\":\"index.css\",\"sourcesContent\":[\"\\nbody { margin: 0 }\\nimg { max-width: 100% }\\nsvg { max-height: 100% }\\n\\n\"],\"sourceRoot\":\"webpack://\"}]);\n\n// exports\n; module.exports = exports.locals; module.exports._style = exports.toString()",
    "./~/normalize.css/normalize.css": "exports = module.exports = require(\"./../css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \"/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */\\n/**\\n * 1. Set default font family to sans-serif.\\n * 2. Prevent iOS and IE text size adjust after device orientation change,\\n *    without disabling user zoom.\\n */\\nhtml {\\n  font-family: sans-serif;\\n  /* 1 */\\n  -ms-text-size-adjust: 100%;\\n  /* 2 */\\n  -webkit-text-size-adjust: 100%;\\n  /* 2 */\\n}\\n\\n/**\\n * Remove default margin.\\n */\\nbody {\\n  margin: 0;\\n}\\n\\n/* HTML5 display definitions\\n   ========================================================================== */\\n/**\\n * Correct `block` display not defined for any HTML5 element in IE 8/9.\\n * Correct `block` display not defined for `details` or `summary` in IE 10/11\\n * and Firefox.\\n * Correct `block` display not defined for `main` in IE 11.\\n */\\narticle,\\naside,\\ndetails,\\nfigcaption,\\nfigure,\\nfooter,\\nheader,\\nhgroup,\\nmain,\\nmenu,\\nnav,\\nsection,\\nsummary {\\n  display: block;\\n}\\n\\n/**\\n * 1. Correct `inline-block` display not defined in IE 8/9.\\n * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.\\n */\\naudio,\\ncanvas,\\nprogress,\\nvideo {\\n  display: inline-block;\\n  /* 1 */\\n  vertical-align: baseline;\\n  /* 2 */\\n}\\n\\n/**\\n * Prevent modern browsers from displaying `audio` without controls.\\n * Remove excess height in iOS 5 devices.\\n */\\naudio:not([controls]) {\\n  display: none;\\n  height: 0;\\n}\\n\\n/**\\n * Address `[hidden]` styling not present in IE 8/9/10.\\n * Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22.\\n */\\n[hidden],\\ntemplate {\\n  display: none;\\n}\\n\\n/* Links\\n   ========================================================================== */\\n/**\\n * Remove the gray background color from active links in IE 10.\\n */\\na {\\n  background-color: transparent;\\n}\\n\\n/**\\n * Improve readability of focused elements when they are also in an\\n * active/hover state.\\n */\\na:active,\\na:hover {\\n  outline: 0;\\n}\\n\\n/* Text-level semantics\\n   ========================================================================== */\\n/**\\n * Address styling not present in IE 8/9/10/11, Safari, and Chrome.\\n */\\nabbr[title] {\\n  border-bottom: 1px dotted;\\n}\\n\\n/**\\n * Address style set to `bolder` in Firefox 4+, Safari, and Chrome.\\n */\\nb,\\nstrong {\\n  font-weight: bold;\\n}\\n\\n/**\\n * Address styling not present in Safari and Chrome.\\n */\\ndfn {\\n  font-style: italic;\\n}\\n\\n/**\\n * Address variable `h1` font-size and margin within `section` and `article`\\n * contexts in Firefox 4+, Safari, and Chrome.\\n */\\nh1 {\\n  font-size: 2em;\\n  margin: 0.67em 0;\\n}\\n\\n/**\\n * Address styling not present in IE 8/9.\\n */\\nmark {\\n  background: #ff0;\\n  color: #000;\\n}\\n\\n/**\\n * Address inconsistent and variable font size in all browsers.\\n */\\nsmall {\\n  font-size: 80%;\\n}\\n\\n/**\\n * Prevent `sub` and `sup` affecting `line-height` in all browsers.\\n */\\nsub,\\nsup {\\n  font-size: 75%;\\n  line-height: 0;\\n  position: relative;\\n  vertical-align: baseline;\\n}\\n\\nsup {\\n  top: -0.5em;\\n}\\n\\nsub {\\n  bottom: -0.25em;\\n}\\n\\n/* Embedded content\\n   ========================================================================== */\\n/**\\n * Remove border when inside `a` element in IE 8/9/10.\\n */\\nimg {\\n  border: 0;\\n}\\n\\n/**\\n * Correct overflow not hidden in IE 9/10/11.\\n */\\nsvg:not(:root) {\\n  overflow: hidden;\\n}\\n\\n/* Grouping content\\n   ========================================================================== */\\n/**\\n * Address margin not present in IE 8/9 and Safari.\\n */\\nfigure {\\n  margin: 1em 40px;\\n}\\n\\n/**\\n * Address differences between Firefox and other browsers.\\n */\\nhr {\\n  box-sizing: content-box;\\n  height: 0;\\n}\\n\\n/**\\n * Contain overflow in all browsers.\\n */\\npre {\\n  overflow: auto;\\n}\\n\\n/**\\n * Address odd `em`-unit font size rendering in all browsers.\\n */\\ncode,\\nkbd,\\npre,\\nsamp {\\n  font-family: monospace, monospace;\\n  font-size: 1em;\\n}\\n\\n/* Forms\\n   ========================================================================== */\\n/**\\n * Known limitation: by default, Chrome and Safari on OS X allow very limited\\n * styling of `select`, unless a `border` property is set.\\n */\\n/**\\n * 1. Correct color not being inherited.\\n *    Known issue: affects color of disabled elements.\\n * 2. Correct font properties not being inherited.\\n * 3. Address margins set differently in Firefox 4+, Safari, and Chrome.\\n */\\nbutton,\\ninput,\\noptgroup,\\nselect,\\ntextarea {\\n  color: inherit;\\n  /* 1 */\\n  font: inherit;\\n  /* 2 */\\n  margin: 0;\\n  /* 3 */\\n}\\n\\n/**\\n * Address `overflow` set to `hidden` in IE 8/9/10/11.\\n */\\nbutton {\\n  overflow: visible;\\n}\\n\\n/**\\n * Address inconsistent `text-transform` inheritance for `button` and `select`.\\n * All other form control elements do not inherit `text-transform` values.\\n * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.\\n * Correct `select` style inheritance in Firefox.\\n */\\nbutton,\\nselect {\\n  text-transform: none;\\n}\\n\\n/**\\n * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\\n *    and `video` controls.\\n * 2. Correct inability to style clickable `input` types in iOS.\\n * 3. Improve usability and consistency of cursor style between image-type\\n *    `input` and others.\\n */\\nbutton,\\nhtml input[type=\\\"button\\\"],\\ninput[type=\\\"reset\\\"],\\ninput[type=\\\"submit\\\"] {\\n  -webkit-appearance: button;\\n  /* 2 */\\n  cursor: pointer;\\n  /* 3 */\\n}\\n\\n/**\\n * Re-set default cursor for disabled elements.\\n */\\nbutton[disabled],\\nhtml input[disabled] {\\n  cursor: default;\\n}\\n\\n/**\\n * Remove inner padding and border in Firefox 4+.\\n */\\nbutton::-moz-focus-inner,\\ninput::-moz-focus-inner {\\n  border: 0;\\n  padding: 0;\\n}\\n\\n/**\\n * Address Firefox 4+ setting `line-height` on `input` using `!important` in\\n * the UA stylesheet.\\n */\\ninput {\\n  line-height: normal;\\n}\\n\\n/**\\n * It's recommended that you don't attempt to style these elements.\\n * Firefox's implementation doesn't respect box-sizing, padding, or width.\\n *\\n * 1. Address box sizing set to `content-box` in IE 8/9/10.\\n * 2. Remove excess padding in IE 8/9/10.\\n */\\ninput[type=\\\"checkbox\\\"],\\ninput[type=\\\"radio\\\"] {\\n  box-sizing: border-box;\\n  /* 1 */\\n  padding: 0;\\n  /* 2 */\\n}\\n\\n/**\\n * Fix the cursor style for Chrome's increment/decrement buttons. For certain\\n * `font-size` values of the `input`, it causes the cursor style of the\\n * decrement button to change from `default` to `text`.\\n */\\ninput[type=\\\"number\\\"]::-webkit-inner-spin-button,\\ninput[type=\\\"number\\\"]::-webkit-outer-spin-button {\\n  height: auto;\\n}\\n\\n/**\\n * 1. Address `appearance` set to `searchfield` in Safari and Chrome.\\n * 2. Address `box-sizing` set to `border-box` in Safari and Chrome.\\n */\\ninput[type=\\\"search\\\"] {\\n  -webkit-appearance: textfield;\\n  /* 1 */\\n  box-sizing: content-box;\\n  /* 2 */\\n}\\n\\n/**\\n * Remove inner padding and search cancel button in Safari and Chrome on OS X.\\n * Safari (but not Chrome) clips the cancel button when the search input has\\n * padding (and `textfield` appearance).\\n */\\ninput[type=\\\"search\\\"]::-webkit-search-cancel-button,\\ninput[type=\\\"search\\\"]::-webkit-search-decoration {\\n  -webkit-appearance: none;\\n}\\n\\n/**\\n * Define consistent border, margin, and padding.\\n */\\nfieldset {\\n  border: 1px solid #c0c0c0;\\n  margin: 0 2px;\\n  padding: 0.35em 0.625em 0.75em;\\n}\\n\\n/**\\n * 1. Correct `color` not being inherited in IE 8/9/10/11.\\n * 2. Remove padding so people aren't caught out if they zero out fieldsets.\\n */\\nlegend {\\n  border: 0;\\n  /* 1 */\\n  padding: 0;\\n  /* 2 */\\n}\\n\\n/**\\n * Remove default vertical scrollbar in IE 8/9/10/11.\\n */\\ntextarea {\\n  overflow: auto;\\n}\\n\\n/**\\n * Don't inherit the `font-weight` (applied by a rule above).\\n * NOTE: the default cannot safely be changed in Chrome and Safari on OS X.\\n */\\noptgroup {\\n  font-weight: bold;\\n}\\n\\n/* Tables\\n   ========================================================================== */\\n/**\\n * Remove most spacing between table cells.\\n */\\ntable {\\n  border-collapse: collapse;\\n  border-spacing: 0;\\n}\\n\\ntd,\\nth {\\n  padding: 0;\\n}\\n\", \"\", {\"version\":3,\"sources\":[\"/./node_modules/normalize.css/node_modules/node_modules/normalize.css/normalize.css\",\"/./node_modules/normalize.css/node_modules/normalize.css/normalize.css\"],\"names\":[],\"mappings\":\"AAAA,4EAA4E;AAE5E;;;;GAIG;AAEH;EACE,wBAAwB;EAAE,OAAO;EACjC,2BAA2B;EAAE,OAAO;EACpC,+BAA+B;EAAE,OAAO;CACzC;;AAED;;GAEG;AAEH;EACE,UAAU;CACX;;AAED;gFACgF;AAEhF;;;;;GAKG;AAEH;;;;;;;;;;;;;EAaE,eAAe;CAChB;;AAED;;;GAGG;AAEH;;;;EAIE,sBAAsB;EAAE,OAAO;EAC/B,yBAAyB;EAAE,OAAO;CACnC;;AAED;;;GAGG;AAEH;EACE,cAAc;EACd,UAAU;CACX;;AAED;;;GAGG;ACDH;;EDKE,cAAc;CACf;;AAED;gFACgF;AAEhF;;GAEG;AAEH;EACE,8BAA8B;CAC/B;;AAED;;;GAGG;AAEH;;EAEE,WAAW;CACZ;;AAED;gFACgF;AAEhF;;GAEG;AAEH;EACE,0BAA0B;CAC3B;;AAED;;GAEG;AAEH;;EAEE,kBAAkB;CACnB;;AAED;;GAEG;AAEH;EACE,mBAAmB;CACpB;;AAED;;;GAGG;AAEH;EACE,eAAe;EACf,iBAAiB;CAClB;;AAED;;GAEG;AAEH;EACE,iBAAiB;EACjB,YAAY;CACb;;AAED;;GAEG;AAEH;EACE,eAAe;CAChB;;AAED;;GAEG;AAEH;;EAEE,eAAe;EACf,eAAe;EACf,mBAAmB;EACnB,yBAAyB;CAC1B;;AAED;EACE,YAAY;CACb;;AAED;EACE,gBAAgB;CACjB;;AAED;gFACgF;AAEhF;;GAEG;AAEH;EACE,UAAU;CACX;;AAED;;GAEG;AAEH;EACE,iBAAiB;CAClB;;AAED;gFACgF;AAEhF;;GAEG;AAEH;EACE,iBAAiB;CAClB;;AAED;;GAEG;AAEH;EACE,wBAAwB;EACxB,UAAU;CACX;;AAED;;GAEG;AAEH;EACE,eAAe;CAChB;;AAED;;GAEG;AAEH;;;;EAIE,kCAAkC;EAClC,eAAe;CAChB;;AAED;gFACgF;AAEhF;;;GAGG;AAEH;;;;;GAKG;AAEH;;;;;EAKE,eAAe;EAAE,OAAO;EACxB,cAAc;EAAE,OAAO;EACvB,UAAU;EAAE,OAAO;CACpB;;AAED;;GAEG;AAEH;EACE,kBAAkB;CACnB;;AAED;;;;;GAKG;AAEH;;EAEE,qBAAqB;CACtB;;AAED;;;;;;GAMG;AAEH;;;;EAIE,2BAA2B;EAAE,OAAO;EACpC,gBAAgB;EAAE,OAAO;CAC1B;;AAED;;GAEG;AAEH;;EAEE,gBAAgB;CACjB;;AAED;;GAEG;AAEH;;EAEE,UAAU;EACV,WAAW;CACZ;;AAED;;;GAGG;AAEH;EACE,oBAAoB;CACrB;;AAED;;;;;;GAMG;AAEH;;EAEE,uBAAuB;EAAE,OAAO;EAChC,WAAW;EAAE,OAAO;CACrB;;AAED;;;;GAIG;AAEH;;EAEE,aAAa;CACd;;AAED;;;GAGG;AAEH;EACE,8BAA8B;EAAE,OAAO;EACvC,wBAAwB;EAAE,OAAO;CAClC;;AAED;;;;GAIG;AAEH;;EAEE,yBAAyB;CAC1B;;AAED;;GAEG;AAEH;EACE,0BAA0B;EAC1B,cAAc;EACd,+BAA+B;CAChC;;AAED;;;GAGG;AAEH;EACE,UAAU;EAAE,OAAO;EACnB,WAAW;EAAE,OAAO;CACrB;;AAED;;GAEG;AAEH;EACE,eAAe;CAChB;;AAED;;;GAGG;AAEH;EACE,kBAAkB;CACnB;;AAED;gFACgF;AAEhF;;GAEG;AAEH;EACE,0BAA0B;EAC1B,kBAAkB;CACnB;;AAED;;EAEE,WAAW;CACZ\",\"file\":\"normalize.css\",\"sourcesContent\":[\"/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */\\n\\n/**\\n * 1. Set default font family to sans-serif.\\n * 2. Prevent iOS and IE text size adjust after device orientation change,\\n *    without disabling user zoom.\\n */\\n\\nhtml {\\n  font-family: sans-serif; /* 1 */\\n  -ms-text-size-adjust: 100%; /* 2 */\\n  -webkit-text-size-adjust: 100%; /* 2 */\\n}\\n\\n/**\\n * Remove default margin.\\n */\\n\\nbody {\\n  margin: 0;\\n}\\n\\n/* HTML5 display definitions\\n   ========================================================================== */\\n\\n/**\\n * Correct `block` display not defined for any HTML5 element in IE 8/9.\\n * Correct `block` display not defined for `details` or `summary` in IE 10/11\\n * and Firefox.\\n * Correct `block` display not defined for `main` in IE 11.\\n */\\n\\narticle,\\naside,\\ndetails,\\nfigcaption,\\nfigure,\\nfooter,\\nheader,\\nhgroup,\\nmain,\\nmenu,\\nnav,\\nsection,\\nsummary {\\n  display: block;\\n}\\n\\n/**\\n * 1. Correct `inline-block` display not defined in IE 8/9.\\n * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.\\n */\\n\\naudio,\\ncanvas,\\nprogress,\\nvideo {\\n  display: inline-block; /* 1 */\\n  vertical-align: baseline; /* 2 */\\n}\\n\\n/**\\n * Prevent modern browsers from displaying `audio` without controls.\\n * Remove excess height in iOS 5 devices.\\n */\\n\\naudio:not([controls]) {\\n  display: none;\\n  height: 0;\\n}\\n\\n/**\\n * Address `[hidden]` styling not present in IE 8/9/10.\\n * Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22.\\n */\\n\\n[hidden],\\ntemplate {\\n  display: none;\\n}\\n\\n/* Links\\n   ========================================================================== */\\n\\n/**\\n * Remove the gray background color from active links in IE 10.\\n */\\n\\na {\\n  background-color: transparent;\\n}\\n\\n/**\\n * Improve readability of focused elements when they are also in an\\n * active/hover state.\\n */\\n\\na:active,\\na:hover {\\n  outline: 0;\\n}\\n\\n/* Text-level semantics\\n   ========================================================================== */\\n\\n/**\\n * Address styling not present in IE 8/9/10/11, Safari, and Chrome.\\n */\\n\\nabbr[title] {\\n  border-bottom: 1px dotted;\\n}\\n\\n/**\\n * Address style set to `bolder` in Firefox 4+, Safari, and Chrome.\\n */\\n\\nb,\\nstrong {\\n  font-weight: bold;\\n}\\n\\n/**\\n * Address styling not present in Safari and Chrome.\\n */\\n\\ndfn {\\n  font-style: italic;\\n}\\n\\n/**\\n * Address variable `h1` font-size and margin within `section` and `article`\\n * contexts in Firefox 4+, Safari, and Chrome.\\n */\\n\\nh1 {\\n  font-size: 2em;\\n  margin: 0.67em 0;\\n}\\n\\n/**\\n * Address styling not present in IE 8/9.\\n */\\n\\nmark {\\n  background: #ff0;\\n  color: #000;\\n}\\n\\n/**\\n * Address inconsistent and variable font size in all browsers.\\n */\\n\\nsmall {\\n  font-size: 80%;\\n}\\n\\n/**\\n * Prevent `sub` and `sup` affecting `line-height` in all browsers.\\n */\\n\\nsub,\\nsup {\\n  font-size: 75%;\\n  line-height: 0;\\n  position: relative;\\n  vertical-align: baseline;\\n}\\n\\nsup {\\n  top: -0.5em;\\n}\\n\\nsub {\\n  bottom: -0.25em;\\n}\\n\\n/* Embedded content\\n   ========================================================================== */\\n\\n/**\\n * Remove border when inside `a` element in IE 8/9/10.\\n */\\n\\nimg {\\n  border: 0;\\n}\\n\\n/**\\n * Correct overflow not hidden in IE 9/10/11.\\n */\\n\\nsvg:not(:root) {\\n  overflow: hidden;\\n}\\n\\n/* Grouping content\\n   ========================================================================== */\\n\\n/**\\n * Address margin not present in IE 8/9 and Safari.\\n */\\n\\nfigure {\\n  margin: 1em 40px;\\n}\\n\\n/**\\n * Address differences between Firefox and other browsers.\\n */\\n\\nhr {\\n  box-sizing: content-box;\\n  height: 0;\\n}\\n\\n/**\\n * Contain overflow in all browsers.\\n */\\n\\npre {\\n  overflow: auto;\\n}\\n\\n/**\\n * Address odd `em`-unit font size rendering in all browsers.\\n */\\n\\ncode,\\nkbd,\\npre,\\nsamp {\\n  font-family: monospace, monospace;\\n  font-size: 1em;\\n}\\n\\n/* Forms\\n   ========================================================================== */\\n\\n/**\\n * Known limitation: by default, Chrome and Safari on OS X allow very limited\\n * styling of `select`, unless a `border` property is set.\\n */\\n\\n/**\\n * 1. Correct color not being inherited.\\n *    Known issue: affects color of disabled elements.\\n * 2. Correct font properties not being inherited.\\n * 3. Address margins set differently in Firefox 4+, Safari, and Chrome.\\n */\\n\\nbutton,\\ninput,\\noptgroup,\\nselect,\\ntextarea {\\n  color: inherit; /* 1 */\\n  font: inherit; /* 2 */\\n  margin: 0; /* 3 */\\n}\\n\\n/**\\n * Address `overflow` set to `hidden` in IE 8/9/10/11.\\n */\\n\\nbutton {\\n  overflow: visible;\\n}\\n\\n/**\\n * Address inconsistent `text-transform` inheritance for `button` and `select`.\\n * All other form control elements do not inherit `text-transform` values.\\n * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.\\n * Correct `select` style inheritance in Firefox.\\n */\\n\\nbutton,\\nselect {\\n  text-transform: none;\\n}\\n\\n/**\\n * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\\n *    and `video` controls.\\n * 2. Correct inability to style clickable `input` types in iOS.\\n * 3. Improve usability and consistency of cursor style between image-type\\n *    `input` and others.\\n */\\n\\nbutton,\\nhtml input[type=\\\"button\\\"], /* 1 */\\ninput[type=\\\"reset\\\"],\\ninput[type=\\\"submit\\\"] {\\n  -webkit-appearance: button; /* 2 */\\n  cursor: pointer; /* 3 */\\n}\\n\\n/**\\n * Re-set default cursor for disabled elements.\\n */\\n\\nbutton[disabled],\\nhtml input[disabled] {\\n  cursor: default;\\n}\\n\\n/**\\n * Remove inner padding and border in Firefox 4+.\\n */\\n\\nbutton::-moz-focus-inner,\\ninput::-moz-focus-inner {\\n  border: 0;\\n  padding: 0;\\n}\\n\\n/**\\n * Address Firefox 4+ setting `line-height` on `input` using `!important` in\\n * the UA stylesheet.\\n */\\n\\ninput {\\n  line-height: normal;\\n}\\n\\n/**\\n * It's recommended that you don't attempt to style these elements.\\n * Firefox's implementation doesn't respect box-sizing, padding, or width.\\n *\\n * 1. Address box sizing set to `content-box` in IE 8/9/10.\\n * 2. Remove excess padding in IE 8/9/10.\\n */\\n\\ninput[type=\\\"checkbox\\\"],\\ninput[type=\\\"radio\\\"] {\\n  box-sizing: border-box; /* 1 */\\n  padding: 0; /* 2 */\\n}\\n\\n/**\\n * Fix the cursor style for Chrome's increment/decrement buttons. For certain\\n * `font-size` values of the `input`, it causes the cursor style of the\\n * decrement button to change from `default` to `text`.\\n */\\n\\ninput[type=\\\"number\\\"]::-webkit-inner-spin-button,\\ninput[type=\\\"number\\\"]::-webkit-outer-spin-button {\\n  height: auto;\\n}\\n\\n/**\\n * 1. Address `appearance` set to `searchfield` in Safari and Chrome.\\n * 2. Address `box-sizing` set to `border-box` in Safari and Chrome.\\n */\\n\\ninput[type=\\\"search\\\"] {\\n  -webkit-appearance: textfield; /* 1 */\\n  box-sizing: content-box; /* 2 */\\n}\\n\\n/**\\n * Remove inner padding and search cancel button in Safari and Chrome on OS X.\\n * Safari (but not Chrome) clips the cancel button when the search input has\\n * padding (and `textfield` appearance).\\n */\\n\\ninput[type=\\\"search\\\"]::-webkit-search-cancel-button,\\ninput[type=\\\"search\\\"]::-webkit-search-decoration {\\n  -webkit-appearance: none;\\n}\\n\\n/**\\n * Define consistent border, margin, and padding.\\n */\\n\\nfieldset {\\n  border: 1px solid #c0c0c0;\\n  margin: 0 2px;\\n  padding: 0.35em 0.625em 0.75em;\\n}\\n\\n/**\\n * 1. Correct `color` not being inherited in IE 8/9/10/11.\\n * 2. Remove padding so people aren't caught out if they zero out fieldsets.\\n */\\n\\nlegend {\\n  border: 0; /* 1 */\\n  padding: 0; /* 2 */\\n}\\n\\n/**\\n * Remove default vertical scrollbar in IE 8/9/10/11.\\n */\\n\\ntextarea {\\n  overflow: auto;\\n}\\n\\n/**\\n * Don't inherit the `font-weight` (applied by a rule above).\\n * NOTE: the default cannot safely be changed in Chrome and Safari on OS X.\\n */\\n\\noptgroup {\\n  font-weight: bold;\\n}\\n\\n/* Tables\\n   ========================================================================== */\\n\\n/**\\n * Remove most spacing between table cells.\\n */\\n\\ntable {\\n  border-collapse: collapse;\\n  border-spacing: 0;\\n}\\n\\ntd,\\nth {\\n  padding: 0;\\n}\\n\",\"/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */\\n/**\\n * 1. Set default font family to sans-serif.\\n * 2. Prevent iOS and IE text size adjust after device orientation change,\\n *    without disabling user zoom.\\n */\\nhtml {\\n  font-family: sans-serif;\\n  /* 1 */\\n  -ms-text-size-adjust: 100%;\\n  /* 2 */\\n  -webkit-text-size-adjust: 100%;\\n  /* 2 */\\n}\\n\\n/**\\n * Remove default margin.\\n */\\nbody {\\n  margin: 0;\\n}\\n\\n/* HTML5 display definitions\\n   ========================================================================== */\\n/**\\n * Correct `block` display not defined for any HTML5 element in IE 8/9.\\n * Correct `block` display not defined for `details` or `summary` in IE 10/11\\n * and Firefox.\\n * Correct `block` display not defined for `main` in IE 11.\\n */\\narticle,\\naside,\\ndetails,\\nfigcaption,\\nfigure,\\nfooter,\\nheader,\\nhgroup,\\nmain,\\nmenu,\\nnav,\\nsection,\\nsummary {\\n  display: block;\\n}\\n\\n/**\\n * 1. Correct `inline-block` display not defined in IE 8/9.\\n * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.\\n */\\naudio,\\ncanvas,\\nprogress,\\nvideo {\\n  display: inline-block;\\n  /* 1 */\\n  vertical-align: baseline;\\n  /* 2 */\\n}\\n\\n/**\\n * Prevent modern browsers from displaying `audio` without controls.\\n * Remove excess height in iOS 5 devices.\\n */\\naudio:not([controls]) {\\n  display: none;\\n  height: 0;\\n}\\n\\n/**\\n * Address `[hidden]` styling not present in IE 8/9/10.\\n * Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22.\\n */\\n[hidden],\\ntemplate {\\n  display: none;\\n}\\n\\n/* Links\\n   ========================================================================== */\\n/**\\n * Remove the gray background color from active links in IE 10.\\n */\\na {\\n  background-color: transparent;\\n}\\n\\n/**\\n * Improve readability of focused elements when they are also in an\\n * active/hover state.\\n */\\na:active,\\na:hover {\\n  outline: 0;\\n}\\n\\n/* Text-level semantics\\n   ========================================================================== */\\n/**\\n * Address styling not present in IE 8/9/10/11, Safari, and Chrome.\\n */\\nabbr[title] {\\n  border-bottom: 1px dotted;\\n}\\n\\n/**\\n * Address style set to `bolder` in Firefox 4+, Safari, and Chrome.\\n */\\nb,\\nstrong {\\n  font-weight: bold;\\n}\\n\\n/**\\n * Address styling not present in Safari and Chrome.\\n */\\ndfn {\\n  font-style: italic;\\n}\\n\\n/**\\n * Address variable `h1` font-size and margin within `section` and `article`\\n * contexts in Firefox 4+, Safari, and Chrome.\\n */\\nh1 {\\n  font-size: 2em;\\n  margin: 0.67em 0;\\n}\\n\\n/**\\n * Address styling not present in IE 8/9.\\n */\\nmark {\\n  background: #ff0;\\n  color: #000;\\n}\\n\\n/**\\n * Address inconsistent and variable font size in all browsers.\\n */\\nsmall {\\n  font-size: 80%;\\n}\\n\\n/**\\n * Prevent `sub` and `sup` affecting `line-height` in all browsers.\\n */\\nsub,\\nsup {\\n  font-size: 75%;\\n  line-height: 0;\\n  position: relative;\\n  vertical-align: baseline;\\n}\\n\\nsup {\\n  top: -0.5em;\\n}\\n\\nsub {\\n  bottom: -0.25em;\\n}\\n\\n/* Embedded content\\n   ========================================================================== */\\n/**\\n * Remove border when inside `a` element in IE 8/9/10.\\n */\\nimg {\\n  border: 0;\\n}\\n\\n/**\\n * Correct overflow not hidden in IE 9/10/11.\\n */\\nsvg:not(:root) {\\n  overflow: hidden;\\n}\\n\\n/* Grouping content\\n   ========================================================================== */\\n/**\\n * Address margin not present in IE 8/9 and Safari.\\n */\\nfigure {\\n  margin: 1em 40px;\\n}\\n\\n/**\\n * Address differences between Firefox and other browsers.\\n */\\nhr {\\n  box-sizing: content-box;\\n  height: 0;\\n}\\n\\n/**\\n * Contain overflow in all browsers.\\n */\\npre {\\n  overflow: auto;\\n}\\n\\n/**\\n * Address odd `em`-unit font size rendering in all browsers.\\n */\\ncode,\\nkbd,\\npre,\\nsamp {\\n  font-family: monospace, monospace;\\n  font-size: 1em;\\n}\\n\\n/* Forms\\n   ========================================================================== */\\n/**\\n * Known limitation: by default, Chrome and Safari on OS X allow very limited\\n * styling of `select`, unless a `border` property is set.\\n */\\n/**\\n * 1. Correct color not being inherited.\\n *    Known issue: affects color of disabled elements.\\n * 2. Correct font properties not being inherited.\\n * 3. Address margins set differently in Firefox 4+, Safari, and Chrome.\\n */\\nbutton,\\ninput,\\noptgroup,\\nselect,\\ntextarea {\\n  color: inherit;\\n  /* 1 */\\n  font: inherit;\\n  /* 2 */\\n  margin: 0;\\n  /* 3 */\\n}\\n\\n/**\\n * Address `overflow` set to `hidden` in IE 8/9/10/11.\\n */\\nbutton {\\n  overflow: visible;\\n}\\n\\n/**\\n * Address inconsistent `text-transform` inheritance for `button` and `select`.\\n * All other form control elements do not inherit `text-transform` values.\\n * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.\\n * Correct `select` style inheritance in Firefox.\\n */\\nbutton,\\nselect {\\n  text-transform: none;\\n}\\n\\n/**\\n * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\\n *    and `video` controls.\\n * 2. Correct inability to style clickable `input` types in iOS.\\n * 3. Improve usability and consistency of cursor style between image-type\\n *    `input` and others.\\n */\\nbutton,\\nhtml input[type=\\\"button\\\"],\\ninput[type=\\\"reset\\\"],\\ninput[type=\\\"submit\\\"] {\\n  -webkit-appearance: button;\\n  /* 2 */\\n  cursor: pointer;\\n  /* 3 */\\n}\\n\\n/**\\n * Re-set default cursor for disabled elements.\\n */\\nbutton[disabled],\\nhtml input[disabled] {\\n  cursor: default;\\n}\\n\\n/**\\n * Remove inner padding and border in Firefox 4+.\\n */\\nbutton::-moz-focus-inner,\\ninput::-moz-focus-inner {\\n  border: 0;\\n  padding: 0;\\n}\\n\\n/**\\n * Address Firefox 4+ setting `line-height` on `input` using `!important` in\\n * the UA stylesheet.\\n */\\ninput {\\n  line-height: normal;\\n}\\n\\n/**\\n * It's recommended that you don't attempt to style these elements.\\n * Firefox's implementation doesn't respect box-sizing, padding, or width.\\n *\\n * 1. Address box sizing set to `content-box` in IE 8/9/10.\\n * 2. Remove excess padding in IE 8/9/10.\\n */\\ninput[type=\\\"checkbox\\\"],\\ninput[type=\\\"radio\\\"] {\\n  box-sizing: border-box;\\n  /* 1 */\\n  padding: 0;\\n  /* 2 */\\n}\\n\\n/**\\n * Fix the cursor style for Chrome's increment/decrement buttons. For certain\\n * `font-size` values of the `input`, it causes the cursor style of the\\n * decrement button to change from `default` to `text`.\\n */\\ninput[type=\\\"number\\\"]::-webkit-inner-spin-button,\\ninput[type=\\\"number\\\"]::-webkit-outer-spin-button {\\n  height: auto;\\n}\\n\\n/**\\n * 1. Address `appearance` set to `searchfield` in Safari and Chrome.\\n * 2. Address `box-sizing` set to `border-box` in Safari and Chrome.\\n */\\ninput[type=\\\"search\\\"] {\\n  -webkit-appearance: textfield;\\n  /* 1 */\\n  box-sizing: content-box;\\n  /* 2 */\\n}\\n\\n/**\\n * Remove inner padding and search cancel button in Safari and Chrome on OS X.\\n * Safari (but not Chrome) clips the cancel button when the search input has\\n * padding (and `textfield` appearance).\\n */\\ninput[type=\\\"search\\\"]::-webkit-search-cancel-button,\\ninput[type=\\\"search\\\"]::-webkit-search-decoration {\\n  -webkit-appearance: none;\\n}\\n\\n/**\\n * Define consistent border, margin, and padding.\\n */\\nfieldset {\\n  border: 1px solid #c0c0c0;\\n  margin: 0 2px;\\n  padding: 0.35em 0.625em 0.75em;\\n}\\n\\n/**\\n * 1. Correct `color` not being inherited in IE 8/9/10/11.\\n * 2. Remove padding so people aren't caught out if they zero out fieldsets.\\n */\\nlegend {\\n  border: 0;\\n  /* 1 */\\n  padding: 0;\\n  /* 2 */\\n}\\n\\n/**\\n * Remove default vertical scrollbar in IE 8/9/10/11.\\n */\\ntextarea {\\n  overflow: auto;\\n}\\n\\n/**\\n * Don't inherit the `font-weight` (applied by a rule above).\\n * NOTE: the default cannot safely be changed in Chrome and Safari on OS X.\\n */\\noptgroup {\\n  font-weight: bold;\\n}\\n\\n/* Tables\\n   ========================================================================== */\\n/**\\n * Remove most spacing between table cells.\\n */\\ntable {\\n  border-collapse: collapse;\\n  border-spacing: 0;\\n}\\n\\ntd,\\nth {\\n  padding: 0;\\n}\\n\"],\"sourceRoot\":\"webpack://\"}]);\n\n// exports\n; module.exports = exports.locals; module.exports._style = exports.toString()"
  }
}

Error:

Error: Cannot find module '-!./../node_modules/css-loader/index.js?modules&importLoaders=2&sourceMap&localIdentName=[local]___[hash:base64:5]!./../node_modules/autoprefixer-loader/index.js?browsers=last 2 version!./../node_modules/sass-loader/index.js?outputStyle=expanded&sourceMap=true&sourceMapContents=true!normalize.css/normalize.css'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (C:\Users\david\www\projects\STI\v3.1\assets\index.scss:3:11)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions.(anonymous function) [as .scss] (C:\Users\david\www\projects\STI\v3.1\node_modules\webpack-isomorphic-tools\babel-transpiled-modules\tools\node-hook.js:100:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
Production:
{"javascript":{"app":"/dist/app-0ccfdbf1209807330568.js"},"styles":{"app":"/dist/app-0ccfdbf1209807330568.css"},"assets":{"./assets/index.scss":"// removed by extract-text-webpack-plugin","./src/common/pages/App/App.scss":"// removed by extract-text-webpack-plugin\nmodule.exports = {\"content\":\"HT6COZRgtOuqJHvvUI2XY\"};"}}

Error:

C:\Users\david\www\projects\STI\v3.1\assets\index.scss:2
});
^

SyntaxError: Unexpected token }
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:404:25)
    at Object.Module._extensions.(anonymous function) [as .scss] (C:\Users\david\www\projects\STI\v3.1\node_modules\webpack-isomorphic-tools\babel-transpiled-modules\tools\node-hook.js:100:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (C:/Users/david/www/projects/STI/v3.1/src/common/pages/App/App.react.js:3:38)
    at Module._compile (module.js:425:26)
    at normalLoader (C:\Users\david\www\projects\STI\v3.1\node_modules\babel-core\lib\api\register\node.js:199:5)
    at Object.require.extensions.(anonymous function) [as .js] (C:\Users\david\www\projects\STI\v3.1\node_modules\babel-core\lib\api\register\node.js:216:7)

OK

Development:
{
  "javascript": {
    "app": "http://localhost:8082/dist/app-2a2cf7557cd6e4a3d05d.js"
  },
  "styles": {},
  "assets": {
    "./assets/index.scss": {},
    "./src/common/pages/App/App.scss": {
      "content": "content___HT6CO"
    },
    "./~/basscss-base-reset/index.css": {},
    "./~/normalize.css/normalize.css": {}
  }
}
Production:
{"javascript":{"app":"/dist/app-0ccfdbf1209807330568.js"},"styles":{"app":"/dist/app-0ccfdbf1209807330568.css"},"assets":{"./assets/index.scss":{},"./src/common/pages/App/App.scss":{"content":"HT6COZRgtOuqJHvvUI2XY"}}}

File Extension Already Occupied

This error just started showing up and I'm not sure what it means?

verion: 2.2.29

[Error: File extension "jpeg" is already occupied by require-hacker]

config

{
    "debug": false,
    "webpack_assets_file_path": "../dist/webpack-main-stats.json",
    "assets": {
        "images": {
            "extensions": [
                "jpeg",
                "jpg",
                "png",
                "gif",
                "svg"
            ]
        },
        "styles": {
            "extensions": [
                "css",
                "scss"
            ]
        }
    }
}
const tools = new WebpackIsomorphicTools(toolsConfig).development(isDev);
tools.server(statsDir).then //...

More than a single candidate module for core-js/object/assign

webpack-isomorphic-tools/plugin] [error]  More than a single candidate module was found in webpack stats for require()d path "[object Object]"
[webpack-isomorphic-tools/plugin]   {
  "id": 304,
  "identifier": "/__redacted__/node_modules/babel-runtime/core-js/object/assign.js",
  "name": "./~/babel-runtime/core-js/object/assign.js",
  "index": 525,
  "index2": 525,
  "size": 94,
  "cacheable": true,
  "built": true,
  "optional": false,
  "prefetched": false,
  "chunks": [
    0
  ],
  "assets": [],
  "issuer": "/__redacted__/node_modules/babel-runtime/helpers/extends.js",
  "failed": false,
  "errors": 0,
  "warnings": 0,
  "reasons": [
    {
      "moduleId": 3,
      "moduleIdentifier": "/__redacted__/node_modules/babel-runtime/helpers/extends.js",
      "module": "./~/babel-runtime/helpers/extends.js",
      "moduleName": "./~/babel-runtime/helpers/extends.js",
      "type": "cjs require",
      "userRequest": "babel-runtime/core-js/object/assign",
      "loc": "3:21-67"
    },
    {
      "moduleId": 29,
      "moduleIdentifier": "/__redacted__/node_modules/react-bootstrap/lib/styleMaps.js",
      "module": "./~/react-bootstrap/lib/styleMaps.js",
      "moduleName": "./~/react-bootstrap/lib/styleMaps.js",
      "type": "cjs require",
      "userRequest": "babel-runtime/core-js/object/assign",
      "loc": "3:21-67"
    }
  ],
  "source": "module.exports = { \"default\": require(\"core-js/library/fn/object/assign\"), __esModule: true };"
}
[webpack-isomorphic-tools/plugin]   {
  "id": 838,
  "identifier": "/__redacted__/node_modules/isomorphic-style-loader/node_modules/babel-runtime/core-js/object/assign.js",
  "name": "./~/isomorphic-style-loader/~/babel-runtime/core-js/object/assign.js",
  "index": 734,
  "index2": 727,
  "size": 94,
  "cacheable": true,
  "built": true,
  "optional": false,
  "prefetched": false,
  "chunks": [
    0
  ],
  "assets": [],
  "issuer": "/__redacted__/node_modules/isomorphic-style-loader/lib/insertCss.js",
  "failed": false,
  "errors": 0,
  "warnings": 0,
  "reasons": [
    {
      "moduleId": 10,
      "moduleIdentifier": "/__redacted__/node_modules/isomorphic-style-loader/lib/insertCss.js",
      "module": "./~/isomorphic-style-loader/lib/insertCss.js",
      "moduleName": "./~/isomorphic-style-loader/lib/insertCss.js",
      "type": "cjs require",
      "userRequest": "babel-runtime/core-js/object/assign",
      "loc": "3:14-60"
    }
  ],
  "source": "module.exports = { \"default\": require(\"core-js/library/fn/object/assign\"), __esModule: true };"
}
/__redacted__/node_modules/webpack-isomorphic-tools/babel-transpiled-modules/plugin/write assets.js:369
            throw new Error('More than a single candidate module was found in webpack stats');
            ^

Error: More than a single candidate module was found in webpack stats
    at /__redacted__/node_modules/webpack-isomorphic-tools/babel-transpiled-modules/plugin/write assets.js:369:10
    at resolver (/__redacted__/node_modules/webpack-isomorphic-tools/node_modules/require-hacker/babel-transpiled-modules/require hacker.js:131:17)
    at Function._module3.default._findPath (/__redacted__/node_modules/webpack-isomorphic-tools/node_modules/require-hacker/babel-transpiled-modules/require hacker.js:436:24)
    at Function.Module._resolveFilename (module.js:335:25)
    at Function._module3.default._resolveFilename (/__redacted__/node_modules/webpack-isomorphic-tools/node_modules/require-hacker/babel-transpiled-modules/require hacker.js:403:34)
    at Function.Module._load (module.js:287:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (!./../../node_modules/isomorphic-style-loader/lib/insertCss.js.webpack-module:4:15)
    at Module._compile (module.js:435:26)
    at Object._module3.default._extensions.(anonymous function) [as .webpack-module] (/__redacted__/node_modules/webpack-isomorphic-tools/node_modules/require-hacker/babel-transpiled-modules/require hacker.js:264:11)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/__redacted__/src/sass/LoginSignupForm.scss.webpack-module:4:21)
    at Module._compile (module.js:435:26)
    at Object._module3.default._extensions.(anonymous function) [as .webpack-module] (/__redacted__/node_modules/webpack-isomorphic-tools/node_modules/require-hacker/babel-transpiled-modules/require hacker.js:264:11)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at populate_assets (/__redacted__/node_modules/webpack-isomorphic-tools/babel-transpiled-modules/plugin/write assets.js:395:31)
    at Object.write_assets [as default] (/__redacted__/node_modules/webpack-isomorphic-tools/babel-transpiled-modules/plugin/write assets.js:63:2)
    at Compiler.<anonymous> (/__redacted__/node_modules/webpack-isomorphic-tools/babel-transpiled-modules/plugin/plugin.js:175:27)
    at Compiler.applyPlugins (/__redacted__/node_modules/webpack/node_modules/tapable/lib/Tapable.js:26:37)
    at Compiler.<anonymous> (/__redacted__/node_modules/webpack/lib/Compiler.js:193:12)
    at Compiler.emitRecords (/__redacted__/node_modules/webpack/lib/Compiler.js:282:37)
    at Compiler.<anonymous> (/__redacted__/node_modules/webpack/lib/Compiler.js:187:11)
    at /__redacted__/node_modules/webpack/lib/Compiler.js:275:11

Webpack source path contains loaders info in webpack-stats.json and it causes error "asset not found".

First of all, thanks for such a great and useful tool.

I have the following error when I'm trying to requre .scss file in my React app:

import React, {Component} from 'react';

export default class BannerAd extends Component {
  render() {
    const styles = require('./Ads.scss');

    return (
      <div className={styles.bannerAdWrapper}>
        <div className={styles.bannerAd}>{this.props.ad}</div>
      </div>
    );
  }
}

console:

[1] [webpack-isomorphic-tools] [debug]  requiring ./components/Ad/Ads.scss
[1] [webpack-isomorphic-tools] [error] asset not found: ./components/Ad/Ads.scss

webpack-stats.json:

{
  "javascript": {
    "main": "http://localhost:3001/dist/main-3e2673a8359a316eb4cc.js"
  },
  "styles": {},
  "assets": {
    "/myproject/~/css-loader?modules&importLoaders=2&sourceMap&localIdentName=[local]___[hash:base64:5]!/myproject/~/autoprefixer-loader?browsers=last 2 version!/myproject/~/sass-loader?outputStyle=expanded&sourceMap!/myproject/components/Ad/Ads.scss": {
      "boxAdWrapper": "boxAdWrapper___2ASei",
      "bannerAdWrapper": "bannerAdWrapper___2xr1Z",
      "boxAd": "boxAd___1q-Nw",
      "bannerAd": "bannerAd___VeW6w",
      "_style": "..."
    }
  }
}

I have a custom path callback workaround in my config, but would be great to have such cases resolved out of the box.

// WebpackIsomorphicToolsPlugin config
var path = require('path');
module.exports = {
      ...
      path: function(mod, options, log) {
        var loaders = mod.name.split('!');
        var name = mod.name
        if (loaders.length) {
          name = loaders[loaders.length - 1];
          name = './' + path.relative(options.project_path, name);
        }
        return name;
      },
      parser: WebpackIsomorphicToolsPlugin.css_modules_loader_parser
    }
  }
}

Thanks,
Sergey

Reasoning behind stats info always being output to the console

Hey there. Just wondering what the reasoning was for always outputting stats info to the console when in development mode?

I'm using webpack-dev-server and have certain aspects of it's stats output switched off, but when I'm using this plugin I have no control over it's stats output, meaning I get duplication/more noise in my console. e.g.:

Hash: 23256a845beab320f89e
Version: webpack 1.12.11
Time: 1783ms
    Asset     Size  Chunks             Chunk Names
bundle.js  2.44 MB       0  [emitted]  main
Time: 1783ms
    Asset     Size  Chunks             Chunk Names
bundle.js  2.44 MB       0  [emitted]  main
webpack: bundle is now VALID.

Do you think it would be a good idea to allow control of this plugins stats output via a configuration option, perhaps similar to the one exposed for webpack-dev-server? Or have I missed something in the docs or with how this plugin works? ๐Ÿ˜

Cheers!

Paths created with template strings are not found when require()d

In development mode, when using a template string to require() an asset like this:

const shortcutIconDir = '../../public/images/icons/shortcuts';

require(`${shortcutIconDir}/76.png`);

The asset not found error is raised. However, passing the literal string like so:

require('../../public/images/icons/shortcuts/76.png');

Successfully adds the asset to the webpack-assets.json manifest.

Here's a repo where the error can be reproduced: https://github.com/jonlong/universal-webpack-troubleshooting

And these are the lines in question: https://github.com/jonlong/universal-webpack-troubleshooting/blob/master/src/components/App.jsx#L8-L12

CSS Modules of css-loader support?

Hi.
I am using this and implementing server side rendering. But this does not work with css-loader with modules option like ?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5].

If compiling css

// a.css
.a {
  color: red;
}

and js importing it

var styles = require('./a.css')
console.log(styles) //  puts ->  Object {a: "a__a___3whEy"}

then webpack-assets.json should be

{
  ...
  "assets": {
    "./a.css": {"a":"a__a___3whEy"}
  }

but in fact it will be like

{
  ...
  "assets": {
    "./a.css": ".a__a___3whEy {\n  color: red;\n}\n"
  }
}

I think internal require-hacker ignores exports.locals even though css-loader generates css class map object as js module like

exports.locals = {
  className: "_23_aKvs-b8bW2Vg3fwHozO",
  subClass: "_13LGdX8RMStbBE9w-t0gZ1"
}

cf. CSS Module section of css-loader

Thanks.

Overloading issue on pre-transpiled code

Not sure if its directly related to this project or more require-hacker, but there is an issue if the image/style tools are used with pre-babeled code. To reduce the memory overhead during runtime, gulp + Babel (5.X) is used. This causes following error on execution:

Debug: internal, implementation, error 
    Error: Uncaught error: Cannot find module './App.styl'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function._module3.default._resolveFilename (.../node_modules/require-hacker/babel-transpiled-modules/require hacker.js:350:34)
    at Function.Module._load (module.js:287:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)

If the original source code is used with runtime compilation via require('babel-core/register')
everything works fine.

require.context is not a function

I'm getting this error when running webpack-isomorphic-tools' withwebpack`

/<dir>/src/content/index.js:9
[1] var contents = require.context('./', true, /content\.yml$/);
[1]                          ^
[1] 
[1] TypeError: require.context is not a function
[1]     at Object.<anonymous> (index.js:2:28)
[1]     at Module._compile (module.js:425:26)
[1]     at loader (/<dir>/node_modules/babel-register/lib/node.js:134:5)
[1]     at Object.require.extensions.(anonymous function) [as .js] (/<dir>/node_modules/babel-register/lib/node.js:144:7)
[1]     at Module.load (module.js:356:32)
[1]     at Function.Module._load (module.js:313:12)
[1]     at Module.require (module.js:366:17)
[1]     at require (module.js:385:17)
[1]     at Object.<anonymous> (/<dir>/src/selectors/index.js:34:16)
[1]     at Module._compile (module.js:425:26)

How to I circumvent/fix this? the code:

var contents = require.context('./', true, /content\.yml$/);

is used to fetch the data files to an array on runtime. The directory tree looks like this:

โ”œโ”€โ”€ content
โ”‚ย ย  โ”œโ”€โ”€ index.js
โ”‚ย ย  โ”œโ”€โ”€ 2013
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ content.yml
โ”‚ย ย  โ”œโ”€โ”€ 2014
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ content.yml
โ”‚ย ย  โ”œโ”€โ”€ 2015
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ content.yml
โ”‚ย ย  โ””โ”€โ”€ 2016
โ”‚ย ย      โ””โ”€โ”€ content.yml

Asset named "' + name + '" was overwritten because of naming collision

I see you are checking @ this line
https://github.com/halt-hammerzeit/webpack-isomorphic-tools/blob/48533b5db3d6864dc1f26d4d9fce67e9bd28aa07/source/helpers.js#L2

for the existence of a parsed asset and you print out an error message if it is already exists. Now if the parsed asset was an empty object (i.e {}) this would be a problem and the message would be misleading.

Not sure if it should check for the emptiness of the object before displaying the message or even before assigning the parsed asset to set[name] @
https://github.com/halt-hammerzeit/webpack-isomorphic-tools/blob/c20c11456be2dcc3d80a2ce88796de406d6f879d/source/plugin/write%20assets.js#L199

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.