add 3rd party libraries to imports

This commit is contained in:
Thomas Grainger 2016-11-29 03:11:21 +00:00
parent 95daa65d7d
commit 661b420103
No known key found for this signature in database
GPG key ID: 995EA0A029283160
28 changed files with 301 additions and 220 deletions

View file

@ -1,8 +1,10 @@
import path from 'path';
import webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import ExtractTextPlugin from 'extract-text-webpack-plugin';
const imageLoader = 'file-loader?name=img/[name]-[sha512:hash:base64:7].[ext]';
const fontLoader = 'file-loader?name=fnt/[name]-[sha512:hash:base64:7].[ext]';
function getCssOptions(target) {
@ -105,6 +107,23 @@ export default {
test: /\.svg(\?[^/]*)?$/,
loader: fontLoader,
},
{
include: require.resolve('bootstrap/js/collapse'),
loader: 'imports-loader?jQuery=jquery',
},
{
include: require.resolve('bootstrap/js/modal'),
loader: 'imports-loader?jQuery=jquery',
},
{
include: require.resolve('bootstrap/js/tooltip'),
loader: 'imports-loader?jQuery=jquery',
},
{
include: require.resolve('bootstrap/js/popover'),
loader: 'imports-loader?jQuery=jquery',
},
{ test: /\.(png|jpg|jpeg|gif|ico)$/, loader: imageLoader },
].concat(cssConfig.loaders),
},
plugins: [
@ -114,5 +133,11 @@ export default {
filename: 'index.html',
compileTime: new Date().toISOString(),
}),
new webpack.ProvidePlugin({
'window.jQuery': 'jquery',
}),
new webpack.DefinePlugin({
COMPILE_TIME: JSON.stringify(new Date()),
})
],
};