Home > @lynx-js/rspeedy > Entry

Entry type

The Entry option is used to set the entry module.

Signature:

export type Entry = string | string[] | Record<string, string | string[] | EntryDescription>;

References: EntryDescription

Remarks

If no value is provided, the default value './src/index.js' will be used.

Example 1

  • Use a single entry:
import { defineConfig } from '@lynx-js/rspeedy'
export default defineConfig({
  entry: './src/pages/main/index.js',
})

Example 2

  • Use a single entry with multiple entry modules:
import { defineConfig } from '@lynx-js/rspeedy'
export default defineConfig({
  entry: ['./src/prefetch.js', './src/pages/main/index.js'],
})

Example 3

  • Use multiple entries(with multiple entry modules):
import { defineConfig } from '@lynx-js/rspeedy'
export default defineConfig({
  entry: {
    foo: './src/pages/foo/index.js',
    bar: ['./src/pages/bar/index.js', './src/post.js'], // multiple entry modules is allowed
  },
})

Example 4

import { defineConfig } from '@lynx-js/rspeedy'
export default defineConfig({
  entry: {
    foo: './src/pages/foo/index.js',
    bar: {
      import: ['./src/prefetch.js', './src/pages/bar'],
    },
  },
})
Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.