Skip to content

Instantly share code, notes, and snippets.

@roman-manchenko
Created September 7, 2016 22:15
Show Gist options
  • Save roman-manchenko/13c3b0a5ec2432fec6b2baef95ca6cc0 to your computer and use it in GitHub Desktop.
Save roman-manchenko/13c3b0a5ec2432fec6b2baef95ca6cc0 to your computer and use it in GitHub Desktop.
var webpack = require('webpack');
var path = require('path');
module.exports = {
context: path.resolve(__dirname, 'static/js'),
entry: {
'apps/frontpage': 'apps/all_posts',
'libs/hogan/hogan_with_filters': 'libs/hogan/hogan_with_filters',
'apps/welcome': 'apps/welcome',
'apps/dashboard': 'apps/dashboard',
'widgets/views/posts/post': 'widgets/views/posts/post',
},
output: {
filename: '[name].js',
chunkFilename: '[id].js',
path: path.resolve(__dirname, 'static/bundles/'),
},
externals: {
engine: 'Engine',
settings: 'Settings',
},
resolve: {
extensions: ['', '.js', '.mustache'],
modulesDirectories: ['./static/js', 'node_modules'],
alias: {
'jquery': 'jquery',
'lazyload' : 'libs/jquery/plugins/jquery.lazyload',
'hogan_with_filters': 'libs/hogan/hogan_with_filters',
'ace': 'libs/ace/ace',
'is': 'libs/require/plugins/is/is',
'is-api': 'libs/require/plugins/is/is-api',
'wl': 'libs/require/plugins/is/whitelabel',
// 'hgn': 'mustache-loader',
'tmpl': 'libs/require/plugins/tmpl',
'css': 'libs/require/plugins/css/css',
'backbone-orig': 'libs/backbone/backbone',
'backbone': 'libs/backbone/backbone.mpatch',
'underscore': 'libs/underscore/underscore',
'hogan': 'libs/hogan/hogan',
'moment': 'libs/moment/moment',
'sprintf': 'libs/sprintf/sprintf',
'highcharts': '/static/js/libs/highcharts/highcharts',
'zeroclipboard': '/static/js/libs/zeroclipboard/zeroclipboard',
'jqueryui': 'libs/jquery/plugins/jqueryui',
'jquery.xdomainrequest': 'libs/jquery/plugins/jquery.xdomainrequest',
'jquery.redactor': 'libs/jquery/plugins/redactor',
'jquery.redactor.v10': 'libs/jquery/plugins/redactorv10',
'redactor.tweaks': 'libs/jquery/plugins/redactor.tweaks',
'redactor.helpers': 'libs/jquery/plugins/redactor.helpers',
'redactor.listicle': 'libs/jquery/plugins/redactor.listicle',
'redactor.listicle_wizard': 'libs/jquery/plugins/redactor.listicle_wizard',
'redactor.captions': 'libs/jquery/plugins/redactor.captions',
'redactor.add_media': 'libs/jquery/plugins/redactor.add_media',
'redactor.expand_link': 'libs/jquery/plugins/redactor.expand_link',
'redactor.page_divider': 'libs/jquery/plugins/redactor.page_divider',
'redactor.image_library': 'libs/jquery/plugins/redactor.image_library',
'redactor.buffer_buttons': 'libs/jquery/plugins/redactor.buffer_buttons',
'redactor.media_controls': 'libs/jquery/plugins/redactor.media_controls',
'redactor.image_pin_description': 'libs/jquery/plugins/redactor.image_pin_description',
'jquery.scrollDepth': 'libs/jquery/plugins/jquery.scrolldepth',
'jquery.scrolltofixed': 'libs/jquery/plugins/jquery-scrolltofixed',
'jquery.placeholder': 'libs/jquery/plugins/jquery.placeholder',
'jquery.rm_autocomplete': 'libs/jquery/plugins/jquery.rm_autocomplete',
'jquery.featureCarousel': 'libs/jquery/plugins/jquery.featureCarousel',
'jquery.slider': 'libs/jquery/plugins/jquery.slides',
'jquery.cookie': 'libs/jquery/plugins/cookie',
'jquery.selection_sharer': 'libs/jquery/plugins/jquery.selection_sharer',
'jquery.slick': 'libs/jquery/plugins/jquery.slick',
'jquery.dotdotdot': 'libs/jquery/plugins/jquery.dotdotdot',
'informer': 'widgets/views/informer',
'tooltip': 'widgets/views/tooltip',
'stripe': 'https://js.stripe.com/v1/stripe', //not really in use
'facebook': 'facebook-node-sdk',
'twitter.impressions': '//platform.twitter.com/impressions',
'sailthru': 'https://ak.sail-horizon.com/horizon/v1', //in use on oneCountry only
'stats_tracker': 'core/stats/tracker',
'backbone.validation': 'libs/backbone/plugins/backbone-validation-amd-min'
},
},
module: {
loaders: [
{test: /jquery\.placeholder/, loader: 'exports?jQuery.fn.placeholder!imports?jquery'},
{test: /\.mustache$/, loader: 'mustache'},
]
},
plugins: [
// new webpack.IgnorePlugin(/settings/),
new webpack.IgnorePlugin(/widgets\/templates\/autocomplete/),
new webpack.IgnorePlugin(/widgets\/templates\/submission_posts/),
new webpack.IgnorePlugin(/widgets\/templates\/submissions\/pagination/),
//new webpack.IgnorePlugin(/engine/),
new webpack.IgnorePlugin(/platform\.instagram\.com/),
//new webpack.IgnorePlugin(/hgn\!widgets\/templates\/sitename_checker/),
// new webpack.IgnorePlugin(/hgn*/),
new webpack.IgnorePlugin(/css*/),
],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment