mirror of
https://github.com/theNewDynamic/gohugo-theme-ananke.git
synced 2025-06-09 01:32:45 +00:00
parent
1b62e7bf1b
commit
75bde5d095
@ -1,6 +1,6 @@
|
|||||||
var path = require("path");
|
var path = require('path');
|
||||||
var ExtractTextPlugin = require("extract-text-webpack-plugin");
|
var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||||
var webpack = require("webpack");
|
var webpack = require('webpack');
|
||||||
module.exports = {
|
module.exports = {
|
||||||
entry: {
|
entry: {
|
||||||
app: './js/main.js'
|
app: './js/main.js'
|
||||||
@ -8,20 +8,20 @@ module.exports = {
|
|||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
test: /\.js$/,
|
test: /\.js$/,
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
use: {
|
use: {
|
||||||
loader: 'babel-loader',
|
loader: 'babel-loader',
|
||||||
options: {
|
options: {
|
||||||
presets: ['env']
|
presets: ['env']
|
||||||
// plugins: [require('babel-plugin-transform-object-rest-spread')]
|
// plugins: [require('babel-plugin-transform-object-rest-spread')]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.css$/,
|
test: /\.css$/,
|
||||||
use: ExtractTextPlugin.extract({
|
use: ExtractTextPlugin.extract({
|
||||||
fallback: "style-loader",
|
fallback: 'style-loader',
|
||||||
use: 'css-loader?importLoaders=1!postcss-loader'
|
use: 'css-loader?importLoaders=1!postcss-loader'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -29,22 +29,27 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
output: {
|
output: {
|
||||||
path: path.join(__dirname, "./../static/dist"),
|
path: path.join(__dirname, './../static/dist'),
|
||||||
filename: '[name].bundle.js',
|
filename: '[name].[chunkhash].js'
|
||||||
},
|
},
|
||||||
|
|
||||||
resolve: {
|
resolve: {
|
||||||
modules: [path.resolve(__dirname, 'src'), 'node_modules'],
|
modules: [path.resolve(__dirname, 'src'), 'node_modules']
|
||||||
},
|
},
|
||||||
|
|
||||||
plugins: [
|
plugins: [
|
||||||
new ExtractTextPlugin("main.css"),
|
new ExtractTextPlugin({
|
||||||
new webpack.ProvidePlugin({
|
filename: getPath => {
|
||||||
$: "jquery",
|
return getPath('[name].[contenthash].css');
|
||||||
jQuery: "jquery"
|
},
|
||||||
})
|
allChunks: true
|
||||||
|
})
|
||||||
|
// new webpack.ProvidePlugin({
|
||||||
|
// $: "jquery",
|
||||||
|
// jQuery: "jquery"
|
||||||
|
// })
|
||||||
],
|
],
|
||||||
watchOptions: {
|
watchOptions: {
|
||||||
watch: true
|
watch: true
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user