<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Vue.js框架 - 模具行业Web开发参考——模具行业从业者必备知识手册]]></title><description><![CDATA[<p dir="auto">&lt;h2&gt;vue&lt;/h2&gt;</p>
<p dir="auto">&lt;h3&gt;Which dist file to use?&lt;/h3&gt;</p>
<p dir="auto">&lt;h4&gt;From CDN or without a Bundler&lt;/h4&gt;</p>
<p dir="auto">&lt;ul&gt;<br />
&lt;li&gt;&lt;strong&gt;&lt;code&gt;vue(.runtime).global(.prod).js&lt;/code&gt;&lt;/strong&gt;:&lt;/li&gt;<br />
&lt;/ul&gt;</p>
<p dir="auto">&lt;ul&gt;<br />
&lt;li&gt;For direct use via &lt;code&gt;&lt;script src="..."&gt;&lt;/code&gt; in the browser. Exposes the &lt;code&gt;Vue&lt;/code&gt; global.&lt;/li&gt;<br />
&lt;li&gt;Note that global builds are not &lt;a href="<a href="https://github.com/umdjs/umd" rel="nofollow ugc">https://github.com/umdjs/umd</a>"&gt;UMD&lt;/a&gt; builds. They are built as &lt;a href="<a href="https://developer.mozilla.org/en-US/docs/Glossary/IIFE" rel="nofollow ugc">https://developer.mozilla.org/en-US/docs/Glossary/IIFE</a>"&gt;IIFEs&lt;/a&gt; and is only meant for direct use via &lt;code&gt;&lt;script src="..."&gt;&lt;/code&gt;.&lt;/li&gt;<br />
&lt;li&gt;In-browser template compilation:&lt;/li&gt;<br />
&lt;li&gt;&lt;strong&gt;&lt;code&gt;vue.global.js&lt;/code&gt;&lt;/strong&gt; is the "full" build that includes both the compiler and the runtime so it supports compiling templates on the fly.&lt;/li&gt;<br />
&lt;li&gt;&lt;strong&gt;&lt;code&gt;vue.runtime.global.js&lt;/code&gt;&lt;/strong&gt; contains only the runtime and requires templates to be pre-compiled during a build step.&lt;/li&gt;<br />
&lt;li&gt;Inlines all Vue core internal packages - i.e. it's a single file with no dependencies on other files. This means you &lt;strong&gt;must&lt;/strong&gt; import everything from this file and this file only to ensure you are getting the same instance of code.&lt;/li&gt;<br />
&lt;li&gt;Contains hard-coded prod/dev branches, and the prod build is pre-minified. Use the &lt;code&gt;*.prod.js&lt;/code&gt; files for production.&lt;/li&gt;<br />
&lt;/ul&gt;</p>
<p dir="auto">&lt;ul&gt;<br />
&lt;li&gt;&lt;strong&gt;&lt;code&gt;vue(.runtime).esm-browser(.prod).js&lt;/code&gt;&lt;/strong&gt;:&lt;/li&gt;<br />
&lt;li&gt;For usage via native ES modules imports (in browser via &lt;code&gt;&lt;script type="module"&gt;&lt;/code&gt;).&lt;/li&gt;<br />
&lt;li&gt;Shares the same runtime compilation, dependency inlining and hard-coded prod/dev behavior with the global build.&lt;/li&gt;<br />
&lt;/ul&gt;</p>
<p dir="auto">&lt;h4&gt;With a Bundler&lt;/h4&gt;</p>
<p dir="auto">&lt;ul&gt;<br />
&lt;li&gt;&lt;strong&gt;&lt;code&gt;vue(.runtime).esm-bundler.js&lt;/code&gt;&lt;/strong&gt;:&lt;/li&gt;<br />
&lt;/ul&gt;</p>
<p dir="auto">&lt;ul&gt;<br />
&lt;li&gt;For use with bundlers like &lt;code&gt;webpack&lt;/code&gt;, &lt;code&gt;rollup&lt;/code&gt; and &lt;code&gt;parcel&lt;/code&gt;.&lt;/li&gt;<br />
&lt;li&gt;Leaves prod/dev branches with &lt;code&gt;process.env.NODE_ENV&lt;/code&gt; guards (must be replaced by bundler)&lt;/li&gt;<br />
&lt;li&gt;Does not ship minified builds (to be done together with the rest of the code after bundling)&lt;/li&gt;<br />
&lt;li&gt;Imports dependencies (e.g. &lt;code&gt;@vue/runtime-core&lt;/code&gt;, &lt;code&gt;@vue/compiler-core&lt;/code&gt;)&lt;/li&gt;<br />
&lt;li&gt;Imported dependencies are also &lt;code&gt;esm-bundler&lt;/code&gt; builds and will in turn import their dependencies (e.g. &lt;code&gt;@vue/runtime-core&lt;/code&gt; imports &lt;code&gt;@vue/reactivity&lt;/code&gt;)&lt;/li&gt;<br />
&lt;li&gt;This means you &lt;strong&gt;can&lt;/strong&gt; install/import these deps individually without ending up with different instances of these dependencies, but you must make sure they all resolve to the same version.&lt;/li&gt;<br />
&lt;li&gt;In-browser template compilation:&lt;/li&gt;<br />
&lt;li&gt;&lt;strong&gt;&lt;code&gt;vue.runtime.esm-bundler.js&lt;/code&gt; (default)&lt;/strong&gt; is runtime only, and requires all templates to be pre-compiled. This is the default entry for bundlers (via &lt;code&gt;module&lt;/code&gt; field in &lt;code&gt;package.json&lt;/code&gt;) because when using a bundler templates are typically pre-compiled (e.g. in &lt;code&gt;*.vue&lt;/code&gt; files).&lt;/li&gt;<br />
&lt;li&gt;&lt;strong&gt;&lt;code&gt;vue.esm-bundler.js&lt;/code&gt;&lt;/strong&gt;: includes the runtime compiler. Use this if you are using a bundler but still want runtime template compilation (e.g. in-DOM templates or templates via inline JavaScript strings). You will need to configure your bundler to alias &lt;code&gt;vue&lt;/code&gt; to this file.&lt;/li&gt;<br />
&lt;/ul&gt;</p>
<p dir="auto">&lt;p&gt;#### Bundler Build Feature Flags&lt;/p&gt;</p>
<p dir="auto">&lt;p&gt;&lt;a href="<a href="https://vuejs.org/api/compile-time-flags.html" rel="nofollow ugc">https://vuejs.org/api/compile-time-flags.html</a>"&gt;Detailed Reference on vuejs.org&lt;/a&gt;&lt;/p&gt;</p>
<p dir="auto">&lt;p&gt;&lt;code&gt;esm-bundler&lt;/code&gt; builds of Vue expose global feature flags that can be overwritten at compile time:&lt;/p&gt;</p>
<p dir="auto">&lt;ul&gt;<br />
&lt;li&gt;&lt;code&gt;<strong>VUE_OPTIONS_API</strong>&lt;/code&gt;&lt;/li&gt;<br />
&lt;/ul&gt;</p>
<p dir="auto">&lt;ul&gt;<br />
&lt;li&gt;Default: &lt;code&gt;true&lt;/code&gt;&lt;/li&gt;<br />
&lt;li&gt;Enable / disable Options API support&lt;/li&gt;<br />
&lt;/ul&gt;</p>
<p dir="auto">&lt;ul&gt;<br />
&lt;li&gt;&lt;code&gt;<strong>VUE_PROD_DEVTOOLS</strong>&lt;/code&gt;&lt;/li&gt;<br />
&lt;/ul&gt;</p>
<p dir="auto">&lt;ul&gt;<br />
&lt;li&gt;Default: &lt;code&gt;false&lt;/code&gt;&lt;/li&gt;<br />
&lt;li&gt;Enable / disable devtools support in production&lt;/li&gt;<br />
&lt;/ul&gt;</p>
<p dir="auto">&lt;ul&gt;<br />
&lt;li&gt;&lt;code&gt;<strong>VUE_PROD_HYDRATION_MISMATCH_DETAILS</strong>&lt;/code&gt;&lt;/li&gt;<br />
&lt;li&gt;Default: &lt;code&gt;false&lt;/code&gt;&lt;/li&gt;<br />
&lt;li&gt;Enable / disable detailed warnings for hydration mismatches in production&lt;/li&gt;<br />
&lt;/ul&gt;</p>
<p dir="auto">&lt;p&gt;The build will work without configuring these flags, however it is &lt;strong&gt;strongly recommended&lt;/strong&gt; to properly configure them in order to get proper tree-shaking in the final bundle.&lt;/p&gt;</p>
<p dir="auto">&lt;h4&gt;For Server-Side Rendering&lt;/h4&gt;</p>
<p dir="auto">&lt;ul&gt;<br />
&lt;li&gt;&lt;strong&gt;&lt;code&gt;vue.cjs(.prod).js&lt;/code&gt;&lt;/strong&gt;:&lt;/li&gt;<br />
&lt;li&gt;For use in Node.js server-side rendering via `requi&lt;/li&gt;<br />
&lt;/ul&gt;</p>
<p dir="auto">&lt;hr&gt;<br />
&lt;p&gt;各位师傅觉得这个方案怎么样？有更好的做法吗？&lt;/p&gt;</p>
]]></description><link>https://forum.mj7.cn/topic/7245/vue-js框架-模具行业web开发参考-模具行业从业者必备知识手册</link><generator>RSS for Node</generator><lastBuildDate>Fri, 02 Oct 2026 08:18:13 GMT</lastBuildDate><atom:link href="https://forum.mj7.cn/topic/7245.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 19 Apr 2026 22:13:35 GMT</pubDate><ttl>60</ttl></channel></rss>