upash / peco

nothing here, move on..
MIT License
209 stars 12 forks source link

fix windows build error #5

Closed uu-z closed 6 years ago

uu-z commented 6 years ago
Module build failed: SyntaxError: D:\Project\Js\peco\examples\blog\.peco\router.js: Octal literal in strict mode (40:41)

  38 |         component: async () => {
  39 |           const [page, LayoutManager] = await Promise.all([
> 40 |               import('dot-peco\data\page\2.json'),
     |                                          ^
  41 |               import('@layout-manager').then(v => v.default)
  42 |             ])
  43 |             return {
    at Parser.raise (D:\Project\Js\peco\node_modules\@babel\core\node_modules\babylon\lib\index.js:779:15)
uu-z commented 6 years ago

in windows the path.join return wrong path, see below

routes:
    Map {
      '/' => { path: 'dot-peco\\data\\index.json', type: 'json' },
      '/page/2' => { path: 'dot-peco\\data\\page\\2.json', type: 'json' },
      '/hi-there' => { path: 'dot-peco/data/hi-there.json', type: 'json' },
      '/your_page_name' => { path: 'dot-peco/data/your_page_name.json', type: 'json' },