gowravshekar / bootstrap-webpack

bootstrap package for webpack
MIT License
136 stars 22 forks source link

bootstrap.config.js doesn't work (in my config) #27

Closed bahlo closed 8 years ago

bahlo commented 8 years ago

Hello,

first: Thanks for creating this library, it works like a charm.

I created a bootstrap.config.js in __dir/src/bootstrap/bootstrap.config.js with the example contents and updated my webpack.base.conf.js to the following:

module.exports = {
  entry: {
    app: [
      'bootstrap-webpack!./src/bootstrap/bootstrap.config.js',
      './src/main.js'
    ]
  },
  // ...
  module: {
    preLoaders: [
      {
        test: /\.vue$/,
        loader: 'eslint',
        include: projectRoot,
        exclude: /node_modules/
      },
      {
        test: /\.js$/,
        loader: 'eslint',
        include: projectRoot,
        exclude: /node_modules/
      }
    ]
  }
}

When I build the app, I get the following error:

ERROR in ./~/bootstrap-webpack/bootstrap-scripts.loader.js!./src/bootstrap/bootstrap.config.js
Module build failed: Error: Cannot find module '/Users/arne/Developer/group/app/node_modules/eslint-loader/index.js!/Users/arne/Developer/group/app/src/bootstrap/bootstrap.config.js'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.module.exports.pitch (/Users/arne/Developer/group/app/node_modules/bootstrap-webpack/bootstrap-scripts.loader.js:20:16)
 @ ./~/bootstrap-webpack/index.loader.js!./src/bootstrap/bootstrap.config.js 2:0-225

So it seems he can't find eslint-loader or the bootstrap.config.js, but both files exist. Plus when I get syntax errors on the file (when I remove the =, i get Unexpected token {).

I also tried prepending !, !! and -! but with not effects.

Any idea how to handle this? Thanks in advance! :+1:

gowravshekar commented 8 years ago

Exclude bootstrap folder from test: /\.js$/

javascript { test: /.js$/, loader: 'eslint', include: projectRoot, exclude: [ /node_modules/, --path-to-bootstrap-folder-- ] }

bahlo commented 8 years ago

Thank you, Gowrav, I'll try that tomorrow - feel free to close this for now. 👍

Am 14.06.2016 um 21:11 schrieb Gowrav Shekar notifications@github.com:

Exclude bootstrap folder from test: /.js$/

{ test: /.js$/, loader: 'eslint', include: projectRoot, exclude: [ /node_modules/, --path-to-bootstrap-folder-- ] } — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

bahlo commented 8 years ago

It works, thank you - I'm still getting started with WebPack 👌🙈