Skip to content

Commit

Permalink
webpack: expose jQuery
Browse files Browse the repository at this point in the history
* Exposes jQuery to the global context as `$` and `jQuery`.

Signed-off-by: Nikos Filippakis <nikolaos.filippakis@cern.ch>
  • Loading branch information
nikofil authored and lnielsen committed Jun 25, 2018
1 parent 6220dcc commit f9e3db3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions invenio_assets/assets/build/webpack.config.js
Expand Up @@ -35,6 +35,16 @@ var webpackConfig = {
},
module: {
rules: [
{
test: require.resolve('jquery'),
use: [{
loader: 'expose-loader',
options: 'jQuery'
},{
loader: 'expose-loader',
options: '$'
}]
},
{
test: /\.js$/,
loader: 'eslint-loader',
Expand Down
3 changes: 2 additions & 1 deletion invenio_assets/assets/package.json
Expand Up @@ -47,7 +47,8 @@
"webpack-hot-middleware": "^2.16.1",
"webpack-merge": "^2.6.1",
"webpack-yam-plugin": "^0.4.0",
"webpack-manifest-plugin": "^1.1.0"
"webpack-manifest-plugin": "^1.1.0",
"expose-loader": "^0.7.3"
},
"engines": {
"node": ">= 4.0.0",
Expand Down

0 comments on commit f9e3db3

Please sign in to comment.