UNPKG

use-theme-editor

Version:

Zero configuration CSS variables based theme editor

77 lines (74 loc) 2.33 kB
const path = require('path'); const dashDash = require('@greenpeace/dashdash') const MiniCssExtractPlugin = require("mini-css-extract-plugin"); module.exports = { watch: true, entry: { bundle: './docs/src/index.js', main: './docs/src/style.scss', halfmoon: './docs/halfmoon/style.scss', }, output: { filename: '[name].js', path: path.resolve(__dirname, 'docs/dist'), }, resolve: { extensions: ['.tsx', '.ts', '.js'], }, devtool: 'source-map', module: { rules: [ { test: /\.(js|jsx|mjs)$/, exclude: /node_modules/, use: { loader: 'babel-loader', options: { babelrc: true, } } }, { test: /\.tsx?$/, use: 'ts-loader', exclude: /node_modules/, }, { test: /\.s[ac]ss$/i, use: [ // Creates `style` nodes from JS strings MiniCssExtractPlugin.loader, { loader: 'css-loader', options: { url: false, sourceMap: true, } }, { loader: 'postcss-loader', options: { postcssOptions: { plugins: [ dashDash(), // ...other plugins ], }, sourceMap: true } }, // Compiles Sass to CSS "sass-loader", ], }, ] }, plugins: [ new MiniCssExtractPlugin({ // Options similar to the same options in webpackOptions.output // both options are optional filename: "[name].css", chunkFilename: "[id].css", }), ], };