Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

Broken jquery #10

Closed
vpetrenko opened this issue Jan 8, 2015 · 6 comments
Closed

Broken jquery #10

vpetrenko opened this issue Jan 8, 2015 · 6 comments

Comments

@vpetrenko
Copy link

webpack src/index.js assets/bundle.js
-------
module.exports = require("./dist/jquery.js");
-------
Hash: e66002ae5e5c3fd56461
Version: webpack 1.4.15
Time: 1644ms
    Asset    Size  Chunks             Chunk Names
bundle.js  615622       0  [emitted]  main
  [10] jquery (bower component) -1 [built] [failed]
    + 165 hidden modules

ERROR in jquery (bower component)
Module build failed: SyntaxError: Unexpected token m
    at Object.parse (native)
    at Object.module.exports (/Users/hh-webpack/node_modules/json-loader/index.js:10:19)
 @ ./index.js 1:8-25
lpiepiora added a commit that referenced this issue Feb 1, 2015
Revert a commit with data.loaders (fix #10)
@seth2810
Copy link
Contributor

seth2810 commented Feb 2, 2015

Facepalm...

@lpiepiora
Copy link
Owner

@vpetrenko can you please check if the latest version fixes this issue?

@vpetrenko
Copy link
Author

Everything seems to work now. Thanks!

@seth2810
Copy link
Contributor

seth2810 commented Feb 4, 2015

If a package is required using the loader, such as require('exports?window.angular!angular'), will be equivalent to require('angular'). I think it's the fact that the expected...

@seth2810
Copy link
Contributor

seth2810 commented Feb 4, 2015

@vpetrenko, can you give us to provide the source code of the project where you thus connect jquery?
Just in my project and I also use the following configuration:

     output: {
        filename: '[name].js',
        libraryTarget: 'var',
        library: '[name]'
      },
      plugins: [
        new BowerPlugin({
          manifestFiles: ['bower.json', '.bower.json']
        }),
        new webpack.ProvidePlugin({
          '$': 'jquery'
        })
      ]

Thus jquery connects automatically from the bower package by using the variable $.

@seth2810
Copy link
Contributor

seth2810 commented Feb 9, 2015

ping

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants