Update Webpack config.
This commit is contained in:
parent
3c32c8648a
commit
d82855b227
2 changed files with 11 additions and 7 deletions
|
@ -1 +0,0 @@
|
|||
!function(r){var o={};function n(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return r[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}n.m=r,n.c=o,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}({6:function(e,t,r){e.exports={"dark-theme":"dark-theme","button-container":"button-container",button:"button",outline:"outline",primary:"primary",link:"link",small:"small",wide:"wide","read-more":"read-more","code-toolbar":"code-toolbar","toolbar-item":"toolbar-item",header:"header",header__right:"header__right",header__inner:"header__inner","theme-toggle":"theme-toggle","theme-toggler":"theme-toggler",logo:"logo",logo__mark:"logo__mark","greater-icon":"greater-icon",logo__text:"logo__text",logo__cursor:"logo__cursor",cursor:"cursor",menu:"menu",menu__inner:"menu__inner","menu__inner--desktop":"menu__inner--desktop","menu__inner--mobile":"menu__inner--mobile","menu__sub-inner":"menu__sub-inner","menu__sub-inner-more":"menu__sub-inner-more","menu__sub-inner-more-trigger":"menu__sub-inner-more-trigger","menu__sub-inner-more-trigger-icon":"menu__sub-inner-more-trigger-icon","menu-trigger":"menu-trigger",center:"center",left:"left",right:"right",container:"container",content:"content",hidden:"hidden",framed:"framed","twitter-tweet":"twitter-tweet",post:"post","post-meta":"post-meta","post-title":"post-title","post-tags":"post-tags","post-content":"post-content","post-cover":"post-cover","post--regulation":"post--regulation",pagination:"pagination",pagination__title:"pagination__title","pagination__title-h":"pagination__title-h",pagination__buttons:"pagination__buttons",button__text:"button__text",next:"next",button__icon:"button__icon",previous:"previous",footer:"footer",footer__inner:"footer__inner",copyright:"copyright","copyright--user":"copyright--user",terms:"terms",terms__list:"terms__list",terms__term:"terms__term","terms__term-count":"terms__term-count",archive:"archive","archive__group-month":"archive__group-month","archive__group-year":"archive__group-year","archive__group-year-header":"archive__group-year-header","archive__group-month-header":"archive__group-month-header","archive__group-posts":"archive__group-posts",archive__post:"archive__post","archive__post-title":"archive__post-title",token:"token","block-comment":"block-comment",cdata:"cdata",comment:"comment",doctype:"doctype",prolog:"prolog",punctuation:"punctuation","attr-name":"attr-name",deleted:"deleted",namespace:"namespace",tag:"tag","function-name":"function-name",boolean:"boolean",function:"function",number:"number","class-name":"class-name",constant:"constant",property:"property",symbol:"symbol",atrule:"atrule",builtin:"builtin",important:"important",keyword:"keyword",selector:"selector","attr-value":"attr-value",char:"char",regex:"regex",string:"string",variable:"variable",entity:"entity",operator:"operator",url:"url",bold:"bold",italic:"italic",inserted:"inserted","line-numbers":"line-numbers","line-numbers-rows":"line-numbers-rows",toolbar:"toolbar","command-line-prompt":"command-line-prompt","collapsable-code":"collapsable-code","collapsable-code__toggle":"collapsable-code__toggle","collapsable-code__title":"collapsable-code__title","collapsable-code__language":"collapsable-code__language"}}});
|
|
@ -8,7 +8,7 @@ const path = require("path");
|
|||
|
||||
const join = (...paths) => path.join(__dirname, ...paths);
|
||||
|
||||
module.exports = (env, { watch }) => ({
|
||||
module.exports = (env, { mode, watch }) => ({
|
||||
resolve: {
|
||||
extensions: [".js", ".css"],
|
||||
modules: ["assets", "node_modules"],
|
||||
|
@ -45,8 +45,8 @@ module.exports = (env, { watch }) => ({
|
|||
{
|
||||
loader: "file-loader",
|
||||
options: {
|
||||
name: '[name].[ext]',
|
||||
outputPath: 'images'
|
||||
name: "[name].[ext]",
|
||||
outputPath: "images",
|
||||
},
|
||||
},
|
||||
],
|
||||
|
@ -57,8 +57,8 @@ module.exports = (env, { watch }) => ({
|
|||
{
|
||||
loader: "file-loader",
|
||||
options: {
|
||||
name: '[name].[ext]',
|
||||
outputPath: 'fonts'
|
||||
name: "[name].[ext]",
|
||||
outputPath: "fonts",
|
||||
},
|
||||
},
|
||||
],
|
||||
|
@ -103,7 +103,12 @@ module.exports = (env, { watch }) => ({
|
|||
plugins: [
|
||||
new CleanWebpackPlugin({
|
||||
cleanOnceBeforeBuildPatterns: [join("static/assets")],
|
||||
cleanAfterEveryBuildPatterns: ["!images/**/*", "!fonts/**/*"],
|
||||
cleanAfterEveryBuildPatterns: [
|
||||
"!images/**/*",
|
||||
"!fonts/**/*",
|
||||
// Remove unused file for a production build.
|
||||
mode === "production" && join("static/assets/style.js"),
|
||||
],
|
||||
verbose: true,
|
||||
}),
|
||||
new MiniCssExtractPlugin({
|
||||
|
|
Loading…
Reference in a new issue