Skip to content
This repository has been archived by the owner on Feb 15, 2025. It is now read-only.

NWB Installing npm package instead of using local directory #83

Closed
ap13p opened this issue Mar 21, 2016 · 3 comments
Closed

NWB Installing npm package instead of using local directory #83

ap13p opened this issue Mar 21, 2016 · 3 comments

Comments

@ap13p
Copy link

ap13p commented Mar 21, 2016

node -v # v4.3.2
npm -v # 3.8.1
nwb -v # 0.8.1

Let say I have the following directory structure

+ src
|-- components
|  | counter.jsx

And my nwb.config.js

'use strict';
const path = require('path');

module.exports = {
    type: 'react-app',
    webpack: {
        extra: {
            resolve: {
                root: [
                    path.resolve(path.join(__dirname, './src/')),
                ],
            },
        },
    },
}

My App.js

import Counter from 'components/counter';

Instead of using local directory which is /src/components nwb install a npm package called components.

@insin
Copy link
Owner

insin commented Mar 21, 2016

This won't work in nwb 0.8.x, as it uses npm-install-webpack-plugin@2 , which doesn't support resolve config.

I've checked that it works in the upcoming version of nwb, which uses npm-install-webpack-plugin@3 - you'll have to avoid the --auto-install flag until then if you want to use resolve.

@ap13p
Copy link
Author

ap13p commented Mar 22, 2016

Nice! Thanks.

Can leave this issue opened until the upcoming version?

@insin
Copy link
Owner

insin commented Mar 22, 2016

It'll auto-close when 0.9 is merged into master

@insin insin closed this as completed in 17f29be Mar 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants