模具配置生成无法独立运行的dist文件

时间:2020-10-04 06:39:43

标签: web-component stenciljs

我已经开始模具开发,并试图从中创建问候世界,但是在尝试单独构建,部署和使用它时,dist文件正在生成一些似乎无法独立运行的随机文件。

我已将文件发布到npm,并尝试在html文件中独立运行。使用unpkg https://unpkg.com/browse/rahulrsingh09-stenciltest2@0.0.2/dist/

<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <title></title>
  <meta name="author" content="">
  <meta name="description" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
 <my-component first="FF" last="'Don't call me a framework' JS"></my-component>
<script src='https://unpkg.com/rahulrsingh09-stenciltest2@0.0.2/dist/index.js'></script>
</body>
</html>

这是来自我在npm中发现的另一个软件包的测试,这似乎可行。

<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <title></title>
  <meta name="author" content="">
  <meta name="description" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  
</head>

<body>

 <my-component first="FF" last="'Don't call me a framework' JS"></my-component>

<script src='https://unpkg.com/web-component-stencil-test@0.0.1/dist/test.js'></script>
</body>

</html>

我发现的唯一区别是https://unpkg.com/browse/web-component-stencil-test@0.0.1/dist/

dist包含项目主体的根文件,该文件可以独立运行,但不会在新的模具配置版本中生成。有关此文档的文档非常稀疏,能否有人指出我在做什么错..在这里或模具缺少的内容。

package.json

"name": "stenciltest2",
  "version": "0.0.2",
  "description": "Stencil Component Starter",
  "main": "dist/index.cjs.js",
  "module": "dist/custom-elements/index.js",
  "es2015": "dist/esm/index.mjs",
  "es2017": "dist/esm/index.mjs",
  "types": "dist/custom-elements/index.d.ts",
  "collection": "dist/collection/collection-manifest.json",
  "collection:main": "dist/collection/index.js",
  "unpkg": "dist/test/test.js",
  "files": [
    "dist/",
    "loader/"
  ],

模具配置

import { Config } from '@stencil/core';

export const config: Config = {
  namespace: 'test',
  buildEs5: true,
  outputTargets: [
    {
      type: 'dist',
      esmLoaderPath: '../loader',
    },
    {
      type: 'dist-custom-elements-bundle',
    },
    {
      type: 'docs-readme',
    },
    {
      type: 'www',
      serviceWorker: null, // disable service workers
    },
  ]
};

1 个答案:

答案 0 :(得分:0)

您是说没有http服务器的“独立”吗?

如果是这样,那么这就是Ionic团队所说的“投降者”。

PROCEDURE SP_ERROR_INS_ERR_COMMON (n_ERR_CODE NUMBER,  c_ERR_SOURCE VARCHAR2,  n_ERR_LINE NUMBER,     c_ERR_DESC VARCHAR2, C_USER_COMMENT VARCHAR2 ) IS
    
    n_Log_Id NUMBER; 
    

    PRAGMA AUTONOMOUS_TRANSACTION;

    BEGIN
    
    n_Log_Id := 0;

    INSERT INTO ERROR_LOG_COMMON
        (ERROR_CODE, ERROR_SOURCE, ERROR_LINE, ERROR_DESCRIPTION, USER_COMMENT)
    VALUES
        (n_ERR_CODE,  c_ERR_SOURCE,  n_ERR_LINE, c_ERR_DESC, C_USER_COMMENT
        );

    COMMIT;

    raise_application_error( -20001,SUBSTR(SQLERRM, 1, 200));

 END SP_ERROR_INS_ERR_COMMON;

您需要在 EXCEPTION WHEN OTHERS THEN vn_errcode := SQLCODE; vc_errmsg := SUBSTR (SQLERRM, 1, 4000); sp_error_ins_err_common(vn_ErrCode, 'SP_RP_DIM_COMPARE', NULL, vc_ErrMsg, substr('batch_id ' || g_BATCH_ID || l_str_err_msg,1,4000) ); RAISE; 中设置stencil build --prerender

baseUrl

请参阅: