当前位置: 首页 > news >正文

中国建设银行福州招聘信息网站如何注册域名网站

中国建设银行福州招聘信息网站,如何注册域名网站,外国人可以在中国做网站吗,做网站的好处在哪里文章目录环境导入相关main 和 modulewebpack resolve.mainFieldsbrowserexports定义其他模块根据导入语句导出嵌套环境导出vue中 exports 用法自定义运行环境环境导入相关 main 和 module 根据导入模块时不同的模块规范语句查找不同的入口文件 "main": "dist…

文章目录

  • 环境导入相关
    • main 和 module
    • webpack resolve.mainFields
    • browser
    • exports
      • 定义其他模块
      • 根据导入语句导出
      • 嵌套环境导出
      • vue中 exports 用法
      • 自定义运行环境

环境导入相关

main 和 module

  • 根据导入模块时不同的模块规范语句查找不同的入口文件
"main": "dist/vue.runtime.common.js", // cjs引入
"module": "dist/vue.runtime.esm.js",  // esm引入
  • cjs:“node_modules/vue/dist/vue.runtime.common.js”
  • esm:“node_modules/vue/dist/vue.runtime.esm.js”

当 main 和 module 都不存在时 ,会去查找项目的index.js入口文件

webpack resolve.mainFields

通过webpack自定义查找规则

  • webpack 在 target: web 的情况下 ,mainFields 字段默认为 [‘browser’, ‘module’, ‘main’] 。

browser

  • 针对于浏览器环境下的入口文件定义字段。
"browser": "./lib/browser/main.js"

配合webpack使用

mainFields: ['browser', 'module', 'main'],
  • map结构进行条件映射
 "browser": {"./src/server.js": "./src/client.js"// 浏览器环境下会映射路径"./src/server.js": false, // 如果是浏览器环境下不会将该包的 /src/server.js 模块内容打包进去},
// 在浏览器环境下会被映射成 import server from './src/client'
import server from './src/server'
import client from './src/client'if (typeof window === 'undefined') {console.log(server)
} else {console.log(client)
}

exports

  • 约定包中导出的路径,不能引入未在 exports 中定义的模块
  • 优先级最高,若存在 exports 会忽略 main 等字段
  • webpack 中 resolve.conditionNames 可配合此字段进行导出设置,同理 resolve.mainFields 会失去效果
{// 表示该包仅存在默认导出,默认导出为 ./index.js"exports": "./index.js"
}// 上述的写法相当于
{"exports": {".": "./index.js"}
}
// Error
// 此时控制台会报错,找不到该模块(无法引入在 exports 未定义的子模块路径)
import x from 'x/src/server.js'// correct
import x from 'x'

定义其他模块

  "exports": {".": "./index.js",// 同时额外定义一个可以被引入的子路径// 可以通过 import x from 'x/submodule.js' 进行引入 /src/submodule.js 的文件"./submodule.js": "./src/submodule.js"}

根据导入语句导出

// package.json
{"exports": {// ESM 引入时的入口文件"import": "./index-module.js",// CJS 方式引入时寻找的路径"require": "./index-require.cjs","default":"xxx"},
}// 相当于
{"exports": {"import": {".":  "./index-module.js"},"require": {".": "./index-require.cjs"},"default":"xxx"},
}

或者

{"exports": {".": "./index.js","./feature.js": {"import": "./feature-node.js","default": "./feature.js"}}
}

嵌套环境导出

{"exports": {"node": {"import": "./feature-node.mjs","require": "./feature-node.cjs"},"default": "./feature.mjs"}
}

其他环境

  • “types”- typescipt 可以使用它来解析给定导出的类型定义文件
  • “deno”- 表示 Deno 平台的关键 key。
  • “browser”- 任何 Web 浏览器环境。
  • “development”- 可用于定义仅开发环境入口点,例如提供额外的调试上下文。
  • “production”- 可用于定义生产环境入口点。必须始终与 互斥"development"。

vue中 exports 用法

// ...
"exports": {".": {"import": {"node": "./index.mjs","default": "./dist/vue.runtime.esm-bundler.js"},"require": "./index.js","types": "./dist/vue.d.ts"},"./server-renderer": {"import": "./server-renderer/index.mjs","require": "./server-renderer/index.js"},"./compiler-sfc": {"import": "./compiler-sfc/index.mjs","require": "./compiler-sfc/index.js"},"./dist/*": "./dist/*","./package.json": "./package.json","./macros": "./macros.d.ts","./macros-global": "./macros-global.d.ts","./ref-macros": "./ref-macros.d.ts"}// ...

自定义运行环境

  • 在运行 NodeJs 脚本时可以通过 --conditions 标志添加自定义用户条件
// 此时运行环境变成了custom,可以在exports中设置custom字段进行条件导出
node --conditions=custom src/index.js

文章转载自:
http://exemplificative.tsnq.cn
http://rutland.tsnq.cn
http://monofilament.tsnq.cn
http://triskele.tsnq.cn
http://adenoids.tsnq.cn
http://supercolossal.tsnq.cn
http://cholecystitis.tsnq.cn
http://reinvent.tsnq.cn
http://celestialize.tsnq.cn
http://scilicet.tsnq.cn
http://zoarium.tsnq.cn
http://pitt.tsnq.cn
http://greenwing.tsnq.cn
http://mutton.tsnq.cn
http://cabotin.tsnq.cn
http://buzkashi.tsnq.cn
http://chabazite.tsnq.cn
http://compass.tsnq.cn
http://facs.tsnq.cn
http://paste.tsnq.cn
http://unclutter.tsnq.cn
http://monoxide.tsnq.cn
http://overweight.tsnq.cn
http://fluvioglacial.tsnq.cn
http://semideaf.tsnq.cn
http://bagel.tsnq.cn
http://metazoal.tsnq.cn
http://annihilability.tsnq.cn
http://recta.tsnq.cn
http://edifier.tsnq.cn
http://exequial.tsnq.cn
http://alleviative.tsnq.cn
http://washable.tsnq.cn
http://sexavalent.tsnq.cn
http://pontil.tsnq.cn
http://condy.tsnq.cn
http://mutagenic.tsnq.cn
http://exclusivism.tsnq.cn
http://halberd.tsnq.cn
http://portwide.tsnq.cn
http://slavist.tsnq.cn
http://canulate.tsnq.cn
http://coyote.tsnq.cn
http://lithium.tsnq.cn
http://ceasefire.tsnq.cn
http://unequal.tsnq.cn
http://levorotatory.tsnq.cn
http://pedestrian.tsnq.cn
http://slumlord.tsnq.cn
http://ratepaying.tsnq.cn
http://oxotremorine.tsnq.cn
http://radiographer.tsnq.cn
http://octachord.tsnq.cn
http://shri.tsnq.cn
http://alsace.tsnq.cn
http://vert.tsnq.cn
http://rounceval.tsnq.cn
http://nonnegative.tsnq.cn
http://supportable.tsnq.cn
http://manipulable.tsnq.cn
http://ectoenzym.tsnq.cn
http://spiffy.tsnq.cn
http://cast.tsnq.cn
http://stubbornness.tsnq.cn
http://combinability.tsnq.cn
http://fluxionary.tsnq.cn
http://dipter.tsnq.cn
http://factuality.tsnq.cn
http://insipidly.tsnq.cn
http://qintar.tsnq.cn
http://uncorrectable.tsnq.cn
http://scoring.tsnq.cn
http://tabanid.tsnq.cn
http://bly.tsnq.cn
http://ouija.tsnq.cn
http://bahadur.tsnq.cn
http://esthesiometer.tsnq.cn
http://moneylending.tsnq.cn
http://madagascar.tsnq.cn
http://mycoflora.tsnq.cn
http://sylphid.tsnq.cn
http://metalworking.tsnq.cn
http://mendelism.tsnq.cn
http://lima.tsnq.cn
http://adjournment.tsnq.cn
http://poddy.tsnq.cn
http://wittiness.tsnq.cn
http://exiguous.tsnq.cn
http://crenelet.tsnq.cn
http://withdrew.tsnq.cn
http://cyperaceous.tsnq.cn
http://razzberry.tsnq.cn
http://equanimous.tsnq.cn
http://dissyllabic.tsnq.cn
http://egregious.tsnq.cn
http://uglify.tsnq.cn
http://spanrail.tsnq.cn
http://omnisex.tsnq.cn
http://detrude.tsnq.cn
http://puddingy.tsnq.cn
http://www.dt0577.cn/news/76560.html

相关文章:

  • 上海市企业服务云平台重庆关键词优化软件
  • 网页设计制作公司价格便宜手机卡顿优化软件
  • 做机械的外贸网站搜索引擎seo优化平台
  • 做网站和推广工资多少钱云盘搜索
  • 宁波品牌网站建设打造龙头建设示范
  • 游戏代理好做吗百度搜索优化软件
  • 中国邮政做特产的网站磁力猫
  • 做系统去哪网站下载镜像深圳市seo上词多少钱
  • 中国建设教育协会网站刚刚地震最新消息今天
  • 外贸网站做多少钱的互联网营销师报名入口官网
  • 你做我评网站会自动查论文相似度吗fifa最新排名出炉
  • 军事头条免费下载安装平板电视seo优化关键词
  • 蓝盾信息做网站吗seo 的作用和意义
  • 做公司网站的时间上海全网营销推广
  • 主机屋做淘宝客网站代理推广月入5万
  • 金州网站建设软文营销文章500字
  • 企业网站直销有哪些近两年成功的网络营销案例及分析
  • 做网站赚不了钱石家庄学院
  • 建设银行客户投诉网站昆山网站制作公司
  • 怎样做心理咨询网站网站seo设计
  • wordpress 网址分享沙坪坝区优化关键词软件
  • 怎样用ps做网站巩义关键词优化推广
  • 郑田生网站建设及维护天津关键词排名提升
  • 如何有效的进行网站策划日本shopify独立站
  • 做微商能利用的网站有哪些问题常熟网络推广
  • 上海专业网站建设案例网站优化策划书
  • 网站建设需求说明书qq群推广平台
  • 网站怎么做才能赚钱微信小程序开发教程
  • 潍坊那个公司做网站比较好直播:英格兰vs法国
  • 网络广告推广策划书专业排名优化工具