diff options
author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2019-06-19 21:18:55 +0200 |
---|---|---|
committer | Dimitri Staessens <dimitri@ouroboros.rocks> | 2019-06-19 21:18:55 +0200 |
commit | 615d2211463e073a65b0de60c61ab1184b14b958 (patch) | |
tree | a7635aec59a689152061c00e8a462382112792f4 /themes/ananke/src/webpack.config.js | |
parent | 2a2311ea3fb1b89a266668bfd16aa96475fc183e (diff) | |
download | website-615d2211463e073a65b0de60c61ab1184b14b958.tar.gz website-615d2211463e073a65b0de60c61ab1184b14b958.zip |
theme: Switch to ananke theme
Diffstat (limited to 'themes/ananke/src/webpack.config.js')
-rw-r--r-- | themes/ananke/src/webpack.config.js | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/themes/ananke/src/webpack.config.js b/themes/ananke/src/webpack.config.js new file mode 100644 index 0000000..b11656d --- /dev/null +++ b/themes/ananke/src/webpack.config.js @@ -0,0 +1,57 @@ +var path = require('path'); +var ExtractTextPlugin = require('extract-text-webpack-plugin'); +var webpack = require('webpack'); +var AssetsPlugin = require('assets-webpack-plugin'); + +module.exports = { + entry: { + app: './js/main.js' + }, + module: { + rules: [ + { + test: /\.js$/, + exclude: /node_modules/, + use: { + loader: 'babel-loader', + options: { + presets: ['env'] + } + } + }, + { + test: /\.css$/, + use: ExtractTextPlugin.extract({ + fallback: 'style-loader', + use: 'css-loader?importLoaders=1!postcss-loader' + }) + } + ] + }, + + output: { + path: path.join(__dirname, './../static/dist'), + filename: 'js/[name].[chunkhash].js' + }, + + resolve: { + modules: [path.resolve(__dirname, 'src'), 'node_modules'] + }, + + plugins: [ + new AssetsPlugin({ + filename: 'webpack_assets.json', + path: path.join(__dirname, '../data'), + prettyPrint: true + }), + new ExtractTextPlugin({ + filename: getPath => { + return getPath('css/[name].[contenthash].css'); + }, + allChunks: true + }) + ], + watchOptions: { + watch: true + } +}; |