Skip to content

Commit

Permalink
add expose-loader for jquery
Browse files Browse the repository at this point in the history
  • Loading branch information
windy committed Jul 21, 2019
1 parent be433cb commit e9d6a48
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions composer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def remove_dir(dir)
after_bundle do
yarn 'webpack@^4.0.0'
yarn 'jquery@^3.3.1'
yarn 'expose-loader'
inject_into_file 'config/webpack/environment.js', after: "const { environment } = require('@rails/webpacker')\n" do <<-EOF
const webpack = require('webpack')
Expand All @@ -75,6 +76,17 @@ def remove_dir(dir)
'window.jQuery': 'jquery',
Popper: ['popper.js', 'default']
}))
environment.loaders.append('expose', {
test: require.resolve('jquery'),
use: [{
loader: 'expose-loader',
options: '$'
}, {
loader: 'expose-loader',
options: 'jQuery',
}]
})
EOF
end
yarn '@fortawesome/fontawesome-free@^5.9.0'
Expand Down Expand Up @@ -140,6 +152,7 @@ def remove_dir(dir)
yarn 'admin-lte@^3.0.0-beta.1'
yarn 'daterangepicker@^3.0.5'
yarn 'moment-timezone'
yarn 'tempusdominus-core'
end

styles = [ 'admin.scss' ]
Expand Down

0 comments on commit e9d6a48

Please sign in to comment.