Newer
Older
var webpack = require('webpack');
var BundleTracker = require('webpack-bundle-tracker');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
var path_bundles = __dirname + '/static_bundles/bundles';
style: [
"./scipost_django/scipost/static/scipost/assets/js/style.js",
],
"./scipost_django/scipost/static/scipost/assets/js/base.js",
],
jquerybase: [
"./scipost_django/scipost/static/scipost/assets/js/scripts.js",
"./scipost_django/scipost/static/scipost/assets/js/base.js",
api: [
"./scipost_django/scipost/static/scipost/assets/js/base.js",
"./scipost_django/scipost/static/scipost/assets/js/api.js",
],
apimail: [
"./scipost_django/scipost/static/scipost/assets/js/base.js",
"./scipost_django/apimail/static/apimail/assets/vue/messages_table.js",
],
mermaid: [
"./scipost_django/scipost/static/scipost/assets/js/activate_mermaid.js",
],
"./scipost_django/scipost/static/scipost/assets/js/base.js",
"./scipost_django/scipost/static/scipost/assets/js/activate_qr.js",
jquerypersonalpage: [
"./scipost_django/scipost/static/scipost/assets/js/dynamic_load.js",
"./scipost_django/scipost/static/scipost/assets/js/scripts.js",
"./scipost_django/scipost/static/scipost/assets/js/base.js",
],
vue: [
"./scipost_vue/search.js",
],
},
output: {
path: path_bundles,
publicPath: '/static/bundles/',
filename: "js/[name]-[fullhash].js",
{
test: require.resolve('jquery'),
loader: 'expose-loader',
options: {
exposes: ['$', 'jQuery'],
},
},
'vue-style-loader',
{
loader: 'style-loader',
options: {
esModule: false,
},
},
{
loader: 'postcss-loader',
options: {
postcssOptions: {
plugins: function() {
return [
require('autoprefixer')
];
}
}
}
},
'sass-loader'
],
},
{
test: /\.vue$/,
loader: 'vue-loader'
},
// {
// test: /\.js$/,
// loader: 'babel-loader'
// },
]
},
new BundleTracker({
filename: './webpack-stats.json'
}),
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery',
// // Tether: 'tether',
// // 'window.Tether': 'tether',
// Popper: ['popper.js', 'default'],
// Alert: "exports-loader?Alert!bootstrap/js/dist/alert",
// Button: "exports-loader?Button!bootstrap/js/dist/button",
// Carousel: "exports-loader?Carousel!bootstrap/js/dist/carousel",
// Collapse: "exports-loader?Collapse!bootstrap/js/dist/collapse",
// Dropdown: "exports-loader?Dropdown!bootstrap/js/dist/dropdown",
// Modal: "exports-loader?Modal!bootstrap/js/dist/modal",
// Popover: "exports-loader?Popover!bootstrap/js/dist/popover",
// Scrollspy: "exports-loader?Scrollspy!bootstrap/js/dist/scrollspy",
// Tab: "exports-loader?Tab!bootstrap/js/dist/tab",
// Tooltip: "exports-loader?Tooltip!bootstrap/js/dist/tooltip",
// Util: 'exports-loader?Util!bootstrap/js/dist/util',
new webpack.optimize.AggressiveMergingPlugin(),
new VueLoaderPlugin()
resolve: {
alias: {
// If using the runtime only build
// Or if using full build of Vue (runtime + compiler) # NOT GOOD WITH CSP
optimization: {
splitChunks: {
chunks: 'all',
},
},