Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Make config more consistent #44

Closed
2 tasks done
insin opened this issue Jan 8, 2016 · 0 comments
Closed
2 tasks done

Make config more consistent #44

insin opened this issue Jan 8, 2016 · 0 comments

Comments

@insin
Copy link
Owner

insin commented Jan 8, 2016

As mentioned in #43, I was probably over-influenced by trying to keep the per-config item example code small when writing the initial Configuration docs.

Nest everything under appropriate props as per babel and karma config:

  • build config object
  • webpack config object

Speculative future full-fat config (including changes required to support #43):

var MyConventionResolver = {
  // ...
}

module.exports = function(deps) {
  type: 'react-component',

  babel: {
    loose: 'all',
    optional: ['runtime'],
    plugins: [require('babel-plugin-react-html-attrs')],
    stage: 0
  },

  webpack: {
    loaders: {
      css: {
        query: {
          modules: true
        }
      },
      install: {
        query: {
          cli: {
            saveExact: true
          }
        },
      },
      extra: [
        // ...
      ]
    },
    plugins: {
      define: {
        __VERSION__: JSON.stringify(require('./package.json').version)
      },
      extra: [
        new deps.webpack.ResolverPlugin([MyConventionResolver])
      ]
    }
  },

  karma: {
    tests: 'test/**/*-test.js',
    frameworks: [
      require('karma-tap')
    ]
  },

  build: {
    umd: true,
    global: 'FooComponent',
    externals: {
      'react': 'React'
    },
    jsNext: true
  }
}

Hopefully the need to manually require plugins in config can also be dealt with as part of #41

@insin insin mentioned this issue Jan 10, 2016
Closed
8 tasks
insin added a commit that referenced this issue Jan 14, 2016
Missing build config is now defaulted.

nwb 0.8 is backwards-compatible with the old config format.

#44
@insin insin closed this as completed in bfd71a8 Feb 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant