Fish Wang says to OwO
// webpack.config.js const path = require("path"); var ExtractTextPlugin = require("extract-text-webpack-plugin"); module.exports = { entry: { "channel-admin": "imports?$=jquery!./public/js/channel-admin.js", // only parts for initial view "channel-light" : [ "normalize_css", "font_awesome", "channel_common_css", "header_css" ], // only parts for initial view "channel-light-admin" : [ "normalize_css", "font_awesome", "channel_common_css", "channel_admin_css", "header_css" ], "channel-common": [ "imports?fancybox,jquery_fancybox_buttons,jquery_fancybox_media,jquery_fancybox_thumbs,$=jquery,lazyload!./public/js/channel-common.js", "imports?Hammer=hammerjs,google_material_icon,moment,polyfill_datepicker,$=jquery,lazyload!./public/js/header.js", "./public/js/scroll-fix.js" ], "channel-common-with-live": [ "imports?fancybox,jquery_fancybox_buttons,jquery_fancybox_media,jquery_fancybox_thumbs,$=jquery,lazyload!./public/js/channel-common.js", "imports?Hammer=hammerjs,google_material_icon,moment,polyfill_datepicker,$=jquery,lazyload!./public/js/header.js", "imports?moment,$=jquery,io=socket_io,md5!./public/js/live.js", "./public/js/scroll-fix.js" ] }, output: { path: path.join(__dirname, "public/packed"), filename: "[name].entry.js", publicPath: "/packed/" }, module: { loaders: [ // Extract css files { test: /\.css$/, loader: ExtractTextPlugin.extract("style-loader", "css-loader?minimize") }, { test: /jquery\.fancybox\.pack\.js$/, loader: "imports?jQuery=jquery,fancybox_css,jquery_mousewheel,jquery_fancybox_buttons_css,jquery_fancybox_thumbs_css" }, { test: /(\/jquery\.fancybox-|\/jquery\.mousewheel-).+\.js$/, loader: "imports?jQuery=jquery" }, { test: /polyfill-datepicker\.js$/, loader:'imports?$=jquery,bootstrap_material_datetimepicker'}, { test: /bootstrap-material-datetimepicker\.js$/, loader: "imports?moment,jQuery=jquery,bootstrap_material_datetimepicker_css" }, { test: /jquery\.lazyload\.js$$/, loader: "imports?jQuery=jquery" }, { test: /\.js$/, loader: 'uglify' }, { test: /\.eot/, loader: 'url-loader?limit=10000&mimetype=application/vnd.ms-fontobject' }, { test: /\.woff2(\?\S*)?$/, loader: 'url-loader?limit=10000&mimetype=application/font-woff2' }, { test: /\.woff(\?\S*)?$/, loader: 'url-loader?limit=10000&mimetype=application/font-woff' }, { test: /\.ttf(\?\S*)?$/, loader: 'url-loader?limit=10000&mimetype=application/font-ttf' }, { test: /\.svg(\?\S*)?$/, loader: 'url-loader?limit=10000&mimetype=image/svg+xml' }, { test: /\.png$|\.jpg$|\.webp$|\.gif/, loader: 'file-loader' } ] }, resolve: { root: path.resolve(__dirname, 'public/'), extensions: ['', '.js', '.json', '.html', '.css'], alias: { "jquery": path.resolve(__dirname, "public/components/jquery/dist/jquery.min.js"), "fancybox": path.resolve(__dirname, "public/components/fancybox/source/jquery.fancybox.pack.js"), "bootstrap_material_datetimepicker": path.resolve(__dirname, "public/components/bootstrap-material-datetimepicker/js/bootstrap-material-datetimepicker.js"), "moment": path.resolve(__dirname, "public/components/moment/moment.js"), "md5": path.resolve(__dirname, "public/js/md5.min.js"), "hammerjs":