{"version":"1.0","provider_name":"\u7ebd\u7ea6\u7f51\u7ad9\u8bbe\u8ba1\u535a\u5ba2","provider_url":"https:\/\/www.369usa.com\/blog","author_name":"darkersss","author_url":"https:\/\/www.369usa.com\/blog\/author\/darkersss\/","title":"\u7528npm\u5b89\u88c5\u548c\u8bbe\u7f6ewebpack - \u7ebd\u7ea6\u7f51\u7ad9\u8bbe\u8ba1\u535a\u5ba2","type":"rich","width":600,"height":338,"html":"<blockquote class=\"wp-embedded-content\" data-secret=\"6hW1ZENa4B\"><a href=\"https:\/\/www.369usa.com\/blog\/%e7%94%a8npm%e5%ae%89%e8%a3%85%e5%92%8c%e8%ae%be%e7%bd%aewebpack\/\">\u7528npm\u5b89\u88c5\u548c\u8bbe\u7f6ewebpack<\/a><\/blockquote><iframe sandbox=\"allow-scripts\" security=\"restricted\" src=\"https:\/\/www.369usa.com\/blog\/%e7%94%a8npm%e5%ae%89%e8%a3%85%e5%92%8c%e8%ae%be%e7%bd%aewebpack\/embed\/#?secret=6hW1ZENa4B\" width=\"600\" height=\"338\" title=\"&#8220;\u7528npm\u5b89\u88c5\u548c\u8bbe\u7f6ewebpack&#8221; &#8212; \u7ebd\u7ea6\u7f51\u7ad9\u8bbe\u8ba1\u535a\u5ba2\" data-secret=\"6hW1ZENa4B\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" class=\"wp-embedded-content\"><\/iframe><script type=\"text\/javascript\">\n\/* <![CDATA[ *\/\n\/*! This file is auto-generated *\/\n!function(d,l){\"use strict\";l.querySelector&&d.addEventListener&&\"undefined\"!=typeof URL&&(d.wp=d.wp||{},d.wp.receiveEmbedMessage||(d.wp.receiveEmbedMessage=function(e){var t=e.data;if((t||t.secret||t.message||t.value)&&!\/[^a-zA-Z0-9]\/.test(t.secret)){for(var s,r,n,a=l.querySelectorAll('iframe[data-secret=\"'+t.secret+'\"]'),o=l.querySelectorAll('blockquote[data-secret=\"'+t.secret+'\"]'),c=new RegExp(\"^https?:$\",\"i\"),i=0;i<o.length;i++)o[i].style.display=\"none\";for(i=0;i<a.length;i++)s=a[i],e.source===s.contentWindow&&(s.removeAttribute(\"style\"),\"height\"===t.message?(1e3<(r=parseInt(t.value,10))?r=1e3:~~r<200&&(r=200),s.height=r):\"link\"===t.message&&(r=new URL(s.getAttribute(\"src\")),n=new URL(t.value),c.test(n.protocol))&&n.host===r.host&&l.activeElement===s&&(d.top.location.href=t.value))}},d.addEventListener(\"message\",d.wp.receiveEmbedMessage,!1),l.addEventListener(\"DOMContentLoaded\",function(){for(var e,t,s=l.querySelectorAll(\"iframe.wp-embedded-content\"),r=0;r<s.length;r++)(t=(e=s[r]).getAttribute(\"data-secret\"))||(t=Math.random().toString(36).substring(2,12),e.src+=\"#?secret=\"+t,e.setAttribute(\"data-secret\",t)),e.contentWindow.postMessage({message:\"ready\",secret:t},\"*\")},!1)))}(window,document);\n\/* ]]> *\/\n<\/script>\n","description":"\u5b89\u88c5Webpack npm i webpack webpack-cli -D &nbsp; \u8bbe\u7f6eWebpack \u5728\u8be5\u6587\u4ef6\u5939\u521b\u5efa\u6587\u4ef6package.json,\u00a0\u7c98\u8d34\u4ee5\u4e0b\u7684\u5185\u5bb9: { \"name\": \"xxxxxx\", \"version\": \"1.0.0\", \"description\": \"blah blah blah\", \"main\": \"index.js\", \"scripts\": { \"start\": \"webpack --mode development\", \"build\": \"webpack --mode production\" }, \"keywords\": [], \"author\": \"\", \"license\": \"ISC\", \"devDependencies\": { \"webpack\": \"^4.0.1\", \"webpack-cli\": \"^2.0.10\" } } \u7136\u540e\u5efa\u7acb\u4e00\u4e2a\u6587\u4ef6\u5939\u53eb &#8220;src&#8221;,\u00a0\u5728\u91cc\u9762\u521b\u5efa\u4e00\u4e2a\u6587\u4ef6\u53ebindex.js. (\u5f53\u7136\u540d\u5b57\u53ef\u4ee5\u4e0d\u4e00\u5b9a\u662findex.js,\u00a0\u662f\u7531&#8221;main&#8221;\u7684\u503c\u800c\u5b9a. &nbsp; \u4f7f\u7528Webpack npm run start \u8fd9\u6307\u4ee4\u4f1a\u751f\u6210\u4ee3\u7801\u5e76\u4fdd\u5b58\u5728&#8221;dist&#8221;\u7684\u6587\u4ef6\u5939\u91cc\u9762. &nbsp; &hellip; Continue reading \"\""}