mirror of
https://github.com/theNewDynamic/gohugo-theme-ananke.git
synced 2025-06-09 01:32:45 +00:00
56 lines
1.0 KiB
JavaScript
56 lines
1.0 KiB
JavaScript
var path = require('path');
|
|
var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
|
var webpack = require('webpack');
|
|
module.exports = {
|
|
entry: {
|
|
app: './js/main.js'
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.js$/,
|
|
exclude: /node_modules/,
|
|
use: {
|
|
loader: 'babel-loader',
|
|
options: {
|
|
presets: ['env']
|
|
// plugins: [require('babel-plugin-transform-object-rest-spread')]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
use: ExtractTextPlugin.extract({
|
|
fallback: 'style-loader',
|
|
use: 'css-loader?importLoaders=1!postcss-loader'
|
|
})
|
|
}
|
|
]
|
|
},
|
|
|
|
output: {
|
|
path: path.join(__dirname, './../static/dist'),
|
|
filename: '[name].[chunkhash].js'
|
|
},
|
|
|
|
resolve: {
|
|
modules: [path.resolve(__dirname, 'src'), 'node_modules']
|
|
},
|
|
|
|
plugins: [
|
|
new ExtractTextPlugin({
|
|
filename: getPath => {
|
|
return getPath('[name].[contenthash].css');
|
|
},
|
|
allChunks: true
|
|
})
|
|
// new webpack.ProvidePlugin({
|
|
// $: "jquery",
|
|
// jQuery: "jquery"
|
|
// })
|
|
],
|
|
watchOptions: {
|
|
watch: true
|
|
}
|
|
};
|