Skip to content

Commit 72756e2

Browse files
committed
update default config
1 parent 4a7723b commit 72756e2

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

src/default.config.js

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,16 @@
1-
const pkg = require("./package.json");
2-
const themeName = pkg.name || "ioptheme";
1+
import { readPackageUp } from "read-package-up";
2+
const themeName = (await readPackageUp()).packageJson.name;
33

4-
module.exports = {
4+
export default {
55
src: `./wp-content/themes/${themeName}/src`,
66
dist: `./wp-content/themes/${themeName}/dist`,
7-
entry: [
8-
"./js/main.js",
9-
"./js/admin.js",
10-
"./js/editor.js",
11-
"./sass/main.scss",
12-
],
13-
publicPath: `/wp-content/themes/${themeName}/dist/`,
147

15-
// enable polling on Windows (no iNotify events), does `isWindows` work?
16-
// This property can be a boolean or an integer > 250
17-
// NOTE: iNotify events sometimes stop working on macOS, restart Docker to get them back
18-
// usePolling: false,
8+
entry: ["./js/main.js", "./js/admin.js", "./js/editor.js"],
9+
10+
publicPath: `/wp-content/themes/${themeName}/dist/`,
1911

20-
// OPTIONAL: Specify a Sass implementation, defaults to sass-embedded. Override with `sass` or `node-sass`.
21-
// sass: "sass",
12+
// sass: "sass-embedded",
13+
// esTarget: "es2020",
2214

23-
// Set the webpack devtool option for sourcemaps
2415
devtool: "source-map",
2516
};

0 commit comments

Comments
 (0)