Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

按这个配置创建了一个项目 #4

Open
zerowch opened this issue Nov 12, 2018 · 1 comment
Open

按这个配置创建了一个项目 #4

zerowch opened this issue Nov 12, 2018 · 1 comment

Comments

@zerowch
Copy link

zerowch commented Nov 12, 2018

但是不知道为什么npm run serve时只能访问index , 其他页面都访问不了

@epver
Copy link
Owner

epver commented Nov 27, 2018

xxxx/index.html
xxxx/login.html
没有处理做每个页面的单独index,如果你需要可以,把每个页面分别配置到文件夹中
filename: ${pageName}/index.html

// 格式化生成入口
entries.forEach((file) => {
  const fileSplit = file.split('/')
  const pageName = fileSplit[2]
  let pageHtml = fileSplit.slice(0, 3).join('/') + '/index.html'
  if (!fs.existsSync(pageHtml)) {
    // 入口如果不配置直接使用 _default.html
    pageHtml = fileSplit.slice(0, 2).join('/') + '/_default.html'
  }
  pages[pageName] = {
    entry: file,
    template: pageHtml,
    filename: `${pageName}/index.html`
  }
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants