43 lines
917 B
JavaScript
43 lines
917 B
JavaScript
const path = require('path');
|
|
const webpack = require('webpack');
|
|
const CleanWebpackPlugin = require('clean-webpack-plugin');
|
|
const ExtractTextPlugin = require("extract-text-webpack-plugin");
|
|
const DynamicCdnWebpackPlugin = require('dynamic-cdn-webpack-plugin');
|
|
|
|
module.exports = {
|
|
entry: './src/index.js',
|
|
output: {
|
|
filename: '[name].bundle.js',
|
|
path: path.resolve(__dirname, 'dist')
|
|
},
|
|
devtool: 'inline-source-map',
|
|
plugins: [
|
|
new ExtractTextPlugin("styles.css"),
|
|
new webpack.ProvidePlugin({ // inject ES5 modules as global vars
|
|
Tether: 'tether'
|
|
})
|
|
],
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.css$/,
|
|
use: ExtractTextPlugin.extract({
|
|
fallback: 'style-loader',
|
|
use: 'css-loader'
|
|
})
|
|
},
|
|
{
|
|
test: /\.(png|svg|jpg|gif)$/,
|
|
use: [
|
|
'file-loader'
|
|
]
|
|
},
|
|
{
|
|
test: /\.(woff|woff2|eot|ttf|otf)$/,
|
|
use: [
|
|
'file-loader'
|
|
]
|
|
}
|
|
]
|
|
}
|
|
};
|