stencil-site icon indicating copy to clipboard operation
stencil-site copied to clipboard

Config copy not working without dest

Open tiloio opened this issue 5 years ago • 0 comments

The documentation says:

The config can also provide an optional dest https://stenciljs.com/docs/config/

But when I do for example this on the app start seed:

import { Config } from "@stencil/core";
// https://stenciljs.com/docs/config

export const config: Config = {
  globalStyle: "src/global/app.css",
  globalScript: "src/global/app.ts",
  copy: [
    {src: "./../readme.md"}
  ],
  outputTargets: [
    {
      type: "www"
      // uncomment the following line to disable service workers in production
      // serviceWorker: null
    }
  ]
};

I am getting this error on npm start:

[19:33.4]  dev server: http://localhost:3333/
[19:33.4]  build finished, watching for changes... in 4.49 s


[ ERROR ]  Unexpected token { C:\sources\hockeytracking\Software\WebApp\sport-tracking-landingpage\stencil.config.ts:1
           (function (exports, require, module, __filename, __dirname) { import { Config } from "@stencil/core"; ^
           SyntaxError: Unexpected token { at new Script (vm.js:79:7) at createScript (vm.js:251:10) at
           Object.runInThisContext (vm.js:303:10) at Module._compile (internal/modules/cjs/loader.js:656:28) at
           Module._extensions..js (internal/modules/cjs/loader.js:699:10) at Object.require.extensions..js
           (C:\sources\hockeytracking\Software\WebApp\sport-tracking-landingpage\node_modules\@stencil\core\dist\sys\node\index.js:1:50607)
           at Module.load (internal/modules/cjs/loader.js:598:32) at tryModuleLoad
           (internal/modules/cjs/loader.js:537:12) at Function.Module._load (internal/modules/cjs/loader.js:529:3) at
           Module.require (internal/modules/cjs/loader.js:636:17)

[20:53.5]  changed file: stencil.config.ts
[20:53.5]  rebuild, app, dev mode, started ...

And this as the npm run build result: image

When I change the config copy part to the following, then everything works as expected:

  copy: [
    {src: "./../readme.md", dest: "./readme.md"}
  ],

tiloio avatar Dec 28 '18 12:12 tiloio