summaryrefslogtreecommitdiff
path: root/neo/webpack.config.js
diff options
context:
space:
mode:
authorTrumeet <yuuta@yuuta.moe>2022-09-11 18:46:12 -0700
committerTrumeet <yuuta@yuuta.moe>2022-09-11 18:46:12 -0700
commit4ec83b487ea4bcdd1235ec01656da37d1138eca0 (patch)
treecdaf08cec26ebc4bb2122ce695a938ab6f1c77e5 /neo/webpack.config.js
parentfc127e45e665fbade7b6e86a4044bbbef646715e (diff)
downloadwww-4ec83b487ea4bcdd1235ec01656da37d1138eca0.tar
www-4ec83b487ea4bcdd1235ec01656da37d1138eca0.tar.gz
www-4ec83b487ea4bcdd1235ec01656da37d1138eca0.tar.bz2
www-4ec83b487ea4bcdd1235ec01656da37d1138eca0.zip
New homepage
Diffstat (limited to 'neo/webpack.config.js')
-rw-r--r--neo/webpack.config.js65
1 files changed, 65 insertions, 0 deletions
diff --git a/neo/webpack.config.js b/neo/webpack.config.js
new file mode 100644
index 0000000..5aecf1e
--- /dev/null
+++ b/neo/webpack.config.js
@@ -0,0 +1,65 @@
+const path = require('path')
+
+const { CleanWebpackPlugin } = require('clean-webpack-plugin')
+const HtmlWebpackPlugin = require('html-webpack-plugin')
+
+module.exports = {
+ context: path.resolve(__dirname, 'src'),
+
+ devServer: {
+ contentBase: path.resolve(__dirname, 'dist')
+ },
+
+ devtool: 'inline-source-map',
+
+ entry: {
+ index: './index.js',
+ },
+
+ module: {
+ rules: [
+ {
+ test: /\.(eot|jpg|png|svg|ttf|webp|woff2?)$/,
+ loader: 'file-loader',
+ options: {
+ name: 'assets/[name].[contenthash:8].[ext]'
+ }
+ },
+ {
+ test: /\.(c|sa|sc)ss$/,
+ use: [
+ 'file-loader?name=[name].[contenthash:8].css',
+ 'extract-loader',
+ {
+ loader: 'css-loader',
+ options: {
+ importLoaders: 1
+ }
+ },
+ {
+ loader: 'postcss-loader',
+ options: {
+ ident: 'postcss',
+ plugins: () => [
+ require('cssnano')({ preset: 'default' }),
+ require('postcss-preset-env')()
+ ]
+ }
+ }
+ ],
+ },
+ ],
+ },
+
+ output: {
+ filename: '[name].[contenthash:8].js',
+ path: path.resolve(__dirname, 'dist'),
+ },
+
+ plugins: [
+ new CleanWebpackPlugin(),
+ new HtmlWebpackPlugin({
+ template: 'index.html'
+ })
+ ]
+} \ No newline at end of file