buner 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/buner.js CHANGED
@@ -13,7 +13,7 @@ import { globby } from "globby";
13
13
  import { exec } from "node:child_process";
14
14
  import validateProjectName from "validate-npm-package-name";
15
15
  const name = "buner";
16
- const version = "1.0.6";
16
+ const version = "1.0.7";
17
17
  const description = "Frontend build toolkit for Vite + React SSR projects — SCSS pipeline, prerender, SSR dev server, and backend integration.";
18
18
  const type = "module";
19
19
  const license = "MIT";
package/index.html CHANGED
@@ -38,7 +38,7 @@
38
38
 
39
39
  <body>
40
40
  <!--app-html-->
41
- <script type="module" src="/xpack/react-loader-init.tsx"></script>
41
+ <script type="module" src="@xpack/react-loader-init.tsx"></script>
42
42
  <script type="module" defer src="#__BASE_URL__/assets/js/pl-states.js"></script>
43
43
  </body>
44
44
  </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "buner",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Frontend build toolkit for Vite + React SSR projects — SCSS pipeline, prerender, SSR dev server, and backend integration.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/xpack/alias.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import path from 'path';
2
2
 
3
- import { root, srcRoot } from './paths';
3
+ import { root, srcRoot, packageRoot } from './paths';
4
4
 
5
5
  const alias = [
6
+ { find: '@src', replacement: srcRoot },
6
7
  { find: '@atoms', replacement: path.resolve(srcRoot, 'atoms') },
7
8
  { find: '@molecules', replacement: path.resolve(srcRoot, 'molecules') },
8
9
  { find: '@organisms', replacement: path.resolve(srcRoot, 'organisms') },
@@ -15,7 +16,7 @@ const alias = [
15
16
  { find: '@_http', replacement: path.resolve(srcRoot, '_http') },
16
17
  { find: '@_api', replacement: path.resolve(srcRoot, '_api') },
17
18
  { find: '@mocks', replacement: path.resolve(srcRoot, 'mocks') },
18
- { find: '@xpack', replacement: path.resolve(root, 'xpack') },
19
+ { find: '@xpack', replacement: path.resolve(packageRoot, 'xpack') },
19
20
  ];
20
21
 
21
22
  export default alias;
@@ -3,7 +3,7 @@ import path from 'path';
3
3
  import { glob } from 'glob';
4
4
  import { PluginOption } from 'vite';
5
5
 
6
- import { root, mode } from '../paths';
6
+ import { root, packageRoot, mode } from '../paths';
7
7
  const scriptOnly = process.env.scriptOnly;
8
8
 
9
9
  const options = (): PluginOption => {
@@ -16,7 +16,7 @@ const options = (): PluginOption => {
16
16
  inputs['index'] = `${root}/index.html`;
17
17
  }
18
18
 
19
- const filePaths = glob.sync(['/src/assets/**/*.entry.ts', '/xpack/scripts/**/*.entry.ts'], { root: root });
19
+ const filePaths = glob.sync([`${root}/src/assets/**/*.entry.ts`, `${packageRoot}/xpack/scripts/**/*.entry.ts`]);
20
20
 
21
21
  [].forEach.call(filePaths, (filePath: string) => {
22
22
  const fileName = path.basename(filePath).toLowerCase();
@@ -1,16 +1,18 @@
1
1
  import { PluginOption } from 'vite';
2
2
 
3
+ import { packageRoot } from '../paths';
4
+
3
5
  const transformIndexHtml = (baseUrl: string): PluginOption => {
4
6
  // console.log('[INIT] transformIndexHtml');
5
7
 
6
8
  return {
7
9
  name: 'xpack-transform-index-html',
8
- enforce: 'post',
10
+ enforce: 'pre',
9
11
 
10
12
  transformIndexHtml(html) {
11
13
  // console.log('transformIndexHtml');
12
14
 
13
- return html.replaceAll('#__BASE_URL__/', baseUrl);
15
+ return html.replaceAll('#__BASE_URL__/', baseUrl).replaceAll('@xpack/', `${packageRoot}/xpack/`);
14
16
  },
15
17
  };
16
18
  };
@@ -1,4 +1,4 @@
1
- import { blocks } from '../src/react-loader';
1
+ import { blocks } from '@src/react-loader';
2
2
  import { initReactLoader } from './react-loader';
3
3
 
4
4
  initReactLoader(blocks);