Skip to content

Commit

Permalink
feat(stark-build): enable writeToDisk in webpack-dev-server configu…
Browse files Browse the repository at this point in the history
…ration
  • Loading branch information
SuperITMan committed Mar 23, 2021
1 parent 30a191d commit 95dcf2c
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions packages/stark-build/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const DefinePlugin = require("webpack/lib/DefinePlugin");
const ContextReplacementPlugin = require("webpack/lib/ContextReplacementPlugin");
const WebpackMonitor = require("webpack-monitor");
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
// const WriteFilePlugin = require("write-file-webpack-plugin");
const StylelintPlugin = require("stylelint-webpack-plugin");
// const InlineManifestWebpackPlugin = require("inline-manifest-webpack-plugin");
// const ScriptExtHtmlWebpackPlugin = require("script-ext-html-webpack-plugin");
Expand Down Expand Up @@ -153,15 +152,6 @@ module.exports = (config, options) => {
* See: https://webpack.js.org/configuration/plugins
*/
plugins: [
// TODO: cannot enable this WriteFilePlugin due to Error: Content and Map of this Source is no longer available (only size() is supported)
// /**
// * Plugin: WriteFilePlugin
// * Description: This plugin makes sure that bundles and assets are written to disk
// * this is necessary so that assets are available in dev mode
// * See: https://www.npmjs.com/package/write-file-webpack-plugin
// */
// new WriteFilePlugin(),

/**
* Plugin: DefinePlugin
* Description: Define free variables.
Expand Down Expand Up @@ -192,15 +182,6 @@ module.exports = (config, options) => {
// TODO evaluate this
// new InlineManifestWebpackPlugin(),

/**
* Plugin: WriteFilePlugin
* Description: This plugin makes sure that bundles and assets are written to disk
* this is necessary so that assets are available in dev mode
* See: https://www.npmjs.com/package/write-file-webpack-plugin
*/
// TODO evaluate this
// new WriteFilePlugin(),

/**
* Plugin: ContextReplacementPlugin
* Description: allows to override the inferred information in a 'require' context
Expand Down Expand Up @@ -269,6 +250,9 @@ module.exports = (config, options) => {
...(METADATA.IS_DEV_SERVER
? {
devServer: {
// See: https://webpack.js.org/configuration/dev-server/#devserverwritetodisk-
writeToDisk: true,

compress: true,

// HTML5 History API support: no need for # in URLs
Expand Down

0 comments on commit 95dcf2c

Please sign in to comment.