|
|
|
@ -12,39 +12,45 @@ module.exports = {
|
|
|
|
|
filename: 'bundle.js', |
|
|
|
|
path: path.resolve(__dirname, 'dist') |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
module: { |
|
|
|
|
//https://getbootstrap.com/docs/4.0/getting-started/webpack/
|
|
|
|
|
loaders: [ |
|
|
|
|
{ |
|
|
|
|
test: /\.(scss)$/, |
|
|
|
|
use: [{ |
|
|
|
|
loader: 'style-loader', // inject CSS to page
|
|
|
|
|
}, { |
|
|
|
|
loader: 'css-loader', // translates CSS into CommonJS modules
|
|
|
|
|
}, { |
|
|
|
|
loader: 'postcss-loader', // Run post css actions
|
|
|
|
|
options: { |
|
|
|
|
plugins: function () { // post css plugins, can be exported to postcss.config.js
|
|
|
|
|
return [ |
|
|
|
|
require('precss'), |
|
|
|
|
require('autoprefixer') |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
loader: 'sass-loader' // compiles Sass to CSS
|
|
|
|
|
}] |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
rules: [ |
|
|
|
|
// https://github.com/webpack-contrib/extract-text-webpack-plugin#extracting-sass-or-less
|
|
|
|
|
{ |
|
|
|
|
test: /\.scss$/, |
|
|
|
|
use: ExtractTextPlugin.extract({ |
|
|
|
|
fallback: 'style-loader', |
|
|
|
|
use: ['css-loader', 'sass-loader'] |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
//https://webpack.js.org/loaders/file-loader/
|
|
|
|
|
{ |
|
|
|
|
test: /\.(png|jpg|gif)$/, |
|
|
|
|
use: [ |
|
|
|
|
{ |
|
|
|
|
loader: 'file-loader', |
|
|
|
|
options: { |
|
|
|
|
outpath: 'img', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
//https://webpack.js.org/loaders/svg-inline-loader/
|
|
|
|
|
// {
|
|
|
|
|
// test: /\.css$/,
|
|
|
|
|
// use: ExtractTextPlugin.extract({
|
|
|
|
|
// fallback: 'style-loader',
|
|
|
|
|
// use: 'css-loader'
|
|
|
|
|
// })
|
|
|
|
|
// },
|
|
|
|
|
// test: /\.svg$/,
|
|
|
|
|
// loader: 'svg-inline-loader'
|
|
|
|
|
// },
|
|
|
|
|
//https://github.com/smooth-code/svgr/tree/master/packages/webpack
|
|
|
|
|
{ |
|
|
|
|
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, |
|
|
|
|
issuer: { |
|
|
|
|
test: /\.jsx?$/ |
|
|
|
|
}, |
|
|
|
|
use: ['babel-loader', '@svgr/webpack', 'file-loader'] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, |
|
|
|
|
loader: 'file-loader' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
test: require.resolve('jquery'), |
|
|
|
|
use: [{ |
|
|
|
@ -66,7 +72,35 @@ module.exports = {
|
|
|
|
|
'window.jQuery': 'jquery', |
|
|
|
|
Popper: ['popper.js', 'default'] |
|
|
|
|
}), |
|
|
|
|
new ExtractTextPlugin("style.css") |
|
|
|
|
new ExtractTextPlugin('style.css') |
|
|
|
|
] |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
//https://getbootstrap.com/docs/4.0/getting-started/webpack/
|
|
|
|
|
// loaders: [
|
|
|
|
|
// {
|
|
|
|
|
// test: /\.scss$/,
|
|
|
|
|
// use: [{
|
|
|
|
|
// loader: 'style-loader', // inject CSS to page
|
|
|
|
|
// }, {
|
|
|
|
|
// loader: 'css-loader', // translates CSS into CommonJS modules
|
|
|
|
|
// }, {
|
|
|
|
|
// loader: 'postcss-loader', // Run post css actions
|
|
|
|
|
// options: {
|
|
|
|
|
// plugins: function () { // post css plugins, can be exported to postcss.config.js
|
|
|
|
|
// return [
|
|
|
|
|
// require('precss'),
|
|
|
|
|
// require('autoprefixer')
|
|
|
|
|
// ];
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }, {
|
|
|
|
|
// loader: 'sass-loader' // compiles Sass to CSS
|
|
|
|
|
// }]
|
|
|
|
|
// }
|
|
|
|
|
// ],
|
|
|
|
|