Created
July 24, 2017 07:54
-
-
Save linktohack/00b987d5f7d897d73d518b315ed5334f to your computer and use it in GitHub Desktop.
Beagle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Webpack | |
config.resolve = config.resolve || {}; | |
config.resolve.alias = config.resolve.alias || {}; | |
Object.assign(config.resolve.alias, { | |
jquery: path.join(__dirname, '/client/assets/lib/jquery/jquery.js'), | |
jqueryGritter: path.join(__dirname, '/client/assets/lib/jquery.gritter/js/jquery.gritter.js'), | |
perfectScrollbar: path.join(__dirname, '/client/assets/lib/perfect-scrollbar/js/perfect-scrollbar.jquery.min.js'), | |
beagleJs: path.join(__dirname, '/client/assets/js/main.js'), | |
testExportJs: path.join(__dirname, '/test-export.js'), | |
}); | |
config.plugins = config.plugins || []; | |
config.plugins.push( | |
new webpack.ProvidePlugin({ | |
jQuery: "jquery", | |
$: "jquery", | |
'window.jQuery': "jquery", | |
'window.$': "jquery", | |
'App': ["beagleJs", "App"] | |
})); | |
config.module = config.module || {}; | |
config.module.noParse = /perfect-scrollbar/; | |
config.module.rules = config.module.rules || []; | |
config.module.rules.push({ | |
test: require.resolve(path.join(__dirname, '/test-export.js')), | |
use: 'exports-loader?a,b' | |
}); | |
config.module.rules.push({ | |
test: require.resolve(path.join(__dirname, '/client/assets/js/main.js')), | |
use: 'exports-loader?App=App' | |
}); | |
console.log('CONFIG', JSON.stringify(config, null, 2)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment