shakacode / bootstrap-loader

Load Bootstrap styles and scripts in your Webpack bundle
MIT License
1.03k stars 487 forks source link

Missing dependancy on 'url-loader' #11

Closed stephenwil closed 8 years ago

stephenwil commented 8 years ago

Hi, Seems that any references through the require of a 'url()' will only work if 'url-loader' is also installed, even though 'resolve-url-loader' is a dependancy here.

Module not found: Error: Cannot resolve module 'url'

E.g. Using a boiler plate such as https://github.com/gaearon/react-transform-boilerplate, and install bootstrap-loader (and the associated dependancies in the intro).

justin808 commented 8 years ago

@alexfedoseev @stephenwil We can add url-loader to the list of peer dependencies.

https://github.com/shakacode/bootstrap-loader/blob/master/package.json#L36

  "peerDependencies": {
    "css-loader": "*",
    "node-sass": "*",
    "resolve-url-loader": "*",
    "sass-loader": "*",
    "webpack": "*"
  },

resolve-url-loader has these dependencies:

https://github.com/bholloway/resolve-url-loader/blob/master/package.json#L28

"dependencies": {
    "camelcase": "^1.2.1",
    "convert-source-map": "^1.1.1",
    "loader-utils": "^0.2.11",
    "lodash.defaults": "^3.1.2",
    "rework": "^1.0.1",
    "rework-visit": "^1.0.0",
    "source-map": "^0.1.43"
  }

@stephenwil Can you try adding the peer dependency and submitting a PR if that does the trick?

AllenFang commented 8 years ago

+1, same error as Module not found: Error: Cannot resolve module 'url'

justin808 commented 8 years ago

i can probably do a PR within the next few days if nobody beats me to it. Nevertheless, even with the PR, it will just report that that you need to install the "peer dependency".

justin808 commented 8 years ago

OK -- I added to master.

Can i get confirmation that this fixes the issue (please use the github format for the package inclusion). Once i get confirmation, I'll release a new version.

AllenFang commented 8 years ago

@justin808, it work, thanks for your patch :)

justin808 commented 8 years ago

@AllenFang Can you please paste your verification. Thanks!

AllenFang commented 8 years ago

I test it in an empty dir and run npm install https://github.com/shakacode/bootstrap-loader.git --save-dev will auto install url-loader by peer dependencies

npm install https://github.com/shakacode/bootstrap-loader.git --save-dev
npm WARN peerDependencies The peer dependency css-loader@* included from bootstrap-loader will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency node-sass@* included from bootstrap-loader will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency resolve-url-loader@* included from bootstrap-loader will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency sass-loader@* included from bootstrap-loader will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency url-loader@* included from bootstrap-loader will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency webpack@* included from bootstrap-loader will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency file-loader@* included from url-loader will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN deprecated lodash@1.0.2: lodash@<2.0.0 is no longer maintained. Upgrade to lodash@^3.0.0
npm WARN optional dep failed, continuing fsevents@1.0.6

> spawn-sync@1.0.15 postinstall /home/user1/Node/test/node_modules/node-sass/node_modules/cross-spawn/node_modules/spawn-sync
> node postinstall

-
> node-sass@3.4.2 install /home/user1/Node/test/node_modules/node-sass
> node scripts/install.js

Binary downloaded and installed at /home/user1/Node/test/node_modules/node-sass/vendor/linux-x64-46/binding.node

> node-sass@3.4.2 postinstall /home/user1/Node/test/node_modules/node-sass
> node scripts/build.js

` /home/user1/Node/test/node_modules/node-sass/vendor/linux-x64-46/binding.node ` exists. 
 testing binary.
Binary is fine; exiting.
sass-loader@3.1.2 node_modules/sass-loader
├── object-assign@4.0.1
├── async@1.5.1
└── loader-utils@0.2.12 (big.js@3.1.3, json5@0.4.0)

resolve-url-loader@1.4.3 node_modules/resolve-url-loader
├── camelcase@1.2.1
├── rework-visit@1.0.0
├── convert-source-map@1.1.3
├── source-map@0.1.43 (amdefine@1.0.0)
├── lodash.defaults@3.1.2 (lodash.restparam@3.6.1, lodash.assign@3.2.0)
├── rework@1.0.1 (convert-source-map@0.3.5, css@2.2.1)
└── loader-utils@0.2.12 (big.js@3.1.3, json5@0.4.0)

file-loader@0.8.5 node_modules/file-loader
└── loader-utils@0.2.12 (big.js@3.1.3, json5@0.4.0)

url-loader@0.5.7 node_modules/url-loader
├── mime@1.2.11
└── loader-utils@0.2.12 (big.js@3.1.3, json5@0.4.0)

webpack@1.12.9 node_modules/webpack
├── interpret@0.6.6
├── tapable@0.1.10
├── clone@1.0.2
├── async@1.5.1
├── esprima@2.7.1
├── supports-color@3.1.2 (has-flag@1.0.0)
├── enhanced-resolve@0.9.1 (graceful-fs@4.1.2, memory-fs@0.2.0)
├── mkdirp@0.5.1 (minimist@0.0.8)
├── optimist@0.6.1 (wordwrap@0.0.3, minimist@0.0.10)
├── memory-fs@0.3.0 (errno@0.1.4, readable-stream@2.0.5)
├── webpack-core@0.6.8 (source-map@0.4.4, source-list-map@0.1.5)
├── loader-utils@0.2.12 (big.js@3.1.3, json5@0.4.0)
├── uglify-js@2.6.1 (async@0.2.10, uglify-to-browserify@1.0.2, source-map@0.5.3, yargs@3.10.0)
├── watchpack@0.2.9 (graceful-fs@4.1.2, async@0.9.2, chokidar@1.4.2)
└── node-libs-browser@0.5.3 (https-browserify@0.0.0, tty-browserify@0.0.0, constants-browserify@0.0.1, path-browserify@0.0.0, punycode@1.4.0, string_decoder@0.10.31, os-browserify@0.1.2, process@0.11.2, assert@1.3.0, domain-browser@1.1.7, querystring-es3@0.2.1, timers-browserify@1.4.2, stream-browserify@1.0.0, events@1.1.0, vm-browserify@0.0.4, readable-stream@1.1.13, util@0.10.3, console-browserify@1.1.0, url@0.10.3, http-browserify@1.7.0, buffer@3.6.0, browserify-zlib@0.1.4, crypto-browserify@3.2.8)

css-loader@0.23.1 node_modules/css-loader
├── postcss-modules-extract-imports@1.0.0
├── postcss-modules-scope@1.0.0
├── object-assign@4.0.1
├── postcss-modules-local-by-default@1.0.1
├── css-selector-tokenizer@0.5.4 (fastparse@1.1.1, cssesc@0.1.0)
├── postcss-modules-values@1.1.1 (icss-replace-symbols@1.0.2)
├── source-list-map@0.1.5
├── lodash.camelcase@3.0.1 (lodash._createcompounder@3.0.0)
├── postcss@5.0.14 (js-base64@2.1.9, source-map@0.5.3, supports-color@3.1.2)
├── loader-utils@0.2.12 (big.js@3.1.3, json5@0.4.0)
└── cssnano@3.4.0 (postcss-normalize-charset@1.1.0, postcss-reduce-transforms@1.0.3, postcss-ordered-values@2.0.2, postcss-minify-gradients@1.0.1, indexes-of@1.0.1, postcss-discard-empty@2.0.0, postcss-discard-duplicates@2.0.0, postcss-convert-values@2.3.4, postcss-reduce-idents@2.2.1, postcss-merge-rules@2.0.3, postcss-discard-comments@2.0.3, postcss-value-parser@3.2.3, defined@1.0.0, decamelize@1.1.2, postcss-merge-longhand@2.0.1, postcss-filter-plugins@2.0.0, postcss-minify-font-values@1.0.2, postcss-zindex@2.0.1, postcss-unique-selectors@2.0.1, postcss-minify-params@1.0.4, postcss-discard-unused@2.1.0, postcss-merge-idents@2.1.3, postcss-calc@5.0.0, postcss-minify-selectors@2.0.1, postcss-normalize-url@3.0.4, postcss-colormin@2.1.8, postcss-svgo@2.1.1, autoprefixer@6.2.3)

node-sass@3.4.2 node_modules/node-sass
├── get-stdin@4.0.1
├── async-foreach@0.1.3
├── chalk@1.1.1 (escape-string-regexp@1.0.4, ansi-styles@2.1.0, supports-color@2.0.0, has-ansi@2.0.0, strip-ansi@3.0.0)
├── nan@2.1.0
├── mkdirp@0.5.1 (minimist@0.0.8)
├── glob@5.0.15 (path-is-absolute@1.0.0, inherits@2.0.1, inflight@1.0.4, once@1.3.3, minimatch@3.0.0)
├── npmconf@2.1.2 (ini@1.3.4, uid-number@0.0.5, inherits@2.0.1, once@1.3.3, semver@4.3.6, osenv@0.1.3, config-chain@1.1.9, nopt@3.0.6)
├── gaze@0.5.2 (globule@0.1.0)
├── cross-spawn@2.1.4 (cross-spawn-async@2.1.6, spawn-sync@1.0.15)
├── meow@3.6.0 (trim-newlines@1.0.0, object-assign@4.0.1, minimist@1.2.0, camelcase-keys@2.0.0, loud-rejection@1.2.0, redent@1.0.0, normalize-package-data@2.3.5, read-pkg-up@1.0.1)
├── request@2.67.0 (aws-sign2@0.6.0, forever-agent@0.6.1, tunnel-agent@0.4.2, oauth-sign@0.8.0, is-typedarray@1.0.0, caseless@0.11.0, stringstream@0.0.5, isstream@0.1.2, json-stringify-safe@5.0.1, extend@3.0.0, tough-cookie@2.2.1, qs@5.2.0, node-uuid@1.4.7, combined-stream@1.0.5, form-data@1.0.0-rc3, mime-types@2.1.8, bl@1.0.0, hawk@3.1.2, http-signature@1.1.0, har-validator@2.0.3)
├── node-gyp@3.2.1 (graceful-fs@4.1.2, semver@5.1.0, osenv@0.1.3, nopt@3.0.6, minimatch@1.0.0, which@1.2.1, fstream@1.0.8, glob@4.5.3, rimraf@2.5.0, tar@2.2.1, path-array@1.0.0, npmlog@1.2.1)
└── sass-graph@2.0.1 (yargs@3.31.0, lodash@3.10.1)

bootstrap-loader@1.0.1 node_modules/bootstrap-loader
├── escape-regexp@0.0.1
├── strip-json-comments@1.0.4
├── semver@5.1.0
├── resolve@1.1.6
├── chalk@1.1.1 (escape-string-regexp@1.0.4, ansi-styles@2.1.0, supports-color@2.0.0, strip-ansi@3.0.0, has-ansi@2.0.0)
├── loader-utils@0.2.12 (big.js@3.1.3, json5@0.4.0)
└── js-yaml@3.4.6 (inherit@2.2.2, esprima@2.7.1, argparse@1.0.3)
justin808 commented 8 years ago

Thanks for pushing 1.0.2, @alexfedoseev!

alex35mil commented 8 years ago

:+1: