Dreampie
Dreampie

Reputation: 1331

angular2 webpack build error

this is code at gist,someone help?

https://gist.github.com/Dreampie/b58dd1152070ecf0f75a4e5fb7200615

Error is :Cannot resolve module 'angular2/platform/browser'

Upvotes: 0

Views: 888

Answers (2)

Dreampie
Dreampie

Reputation: 1331

resolve: {
  modulesDirectories: ['node_modules'],
  extensions: ['', '.html', '.less', '.js', '.ts']
}

add .js to resolve

Upvotes: 1

Sean Larkin
Sean Larkin

Reputation: 6430

I wonder if you need to add the 'root' property to your resolve object: I use a helper function to return the root path seen in my Angular2-Webpack-Lite boilerplate

resolve: {
    root: root('src')
}

If this doesn't help, feel free to take a look at my boilerplate and see the rest of my configuration.

Upvotes: 0

Related Questions