-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpreact.config.js
More file actions
20 lines (16 loc) · 856 Bytes
/
preact.config.js
File metadata and controls
20 lines (16 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { resolve } from "path";
import netlifyPlugin from "preact-cli-plugin-netlify";
import Critters from "critters-webpack-plugin";
import CopyPlugin from "copy-webpack-plugin";
export default function(config, env, helpers) {
config.resolve.alias.src = resolve(__dirname, "./src");
config.resolve.alias.components = resolve(__dirname, "./src/components");
config.resolve.alias.sections = resolve(__dirname, "./src/sections");
config.resolve.alias.style = resolve(__dirname, "./src/style");
config.resolve.alias.lib = resolve(__dirname, "./src/lib");
let { rule } = helpers.getLoadersByName(config, "babel-loader")[0];
let babelConfig = rule.options;
config.plugins.push(new CopyPlugin([{ from: "./robots.txt", to: "./" }]));
babelConfig.plugins.push("@babel/plugin-proposal-export-default-from");
return netlifyPlugin(config);
}