expose jquery in global window

This commit is contained in:
vitorsemeano 2020-10-18 15:29:40 +01:00
parent 86a9f4e36f
commit 6a139dd2be
3 changed files with 20 additions and 0 deletions

View File

@ -26,6 +26,7 @@
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-promise": "^4.2.1",
"expose-loader": "^1.0.1",
"file-loader": "^6.2.0",
"gulp": "^4.0.2",
"gulp-babel": "^8.0.0",

View File

@ -28,5 +28,16 @@ module.exports = {
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'dist')
},
module: {
rules: [
{
test: require.resolve('jquery'),
loader: 'expose-loader',
options: {
exposes: ['$', 'jQuery']
}
}
]
}
};

View File

@ -4440,6 +4440,14 @@ expand-tilde@^2.0.0, expand-tilde@^2.0.2:
dependencies:
homedir-polyfill "^1.0.1"
expose-loader@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/expose-loader/-/expose-loader-1.0.1.tgz#f44d2514daa64e7b06818f15f474c4c6e55dbf17"
integrity sha512-FcxYU+tfzik+0Ve6Ymw8lKJNWhMQpuJOEkLhz0fGIgfDdFKxkr+BSSTkw+MRkK51hemQ+1eR7c2H46E5CxtBZw==
dependencies:
loader-utils "^2.0.0"
schema-utils "^3.0.0"
ext-list@^2.0.0:
version "2.2.2"
resolved "https://registry.yarnpkg.com/ext-list/-/ext-list-2.2.2.tgz#0b98e64ed82f5acf0f2931babf69212ef52ddd37"