Skip to content

Instantly share code, notes, and snippets.

@jemsgit
Created December 9, 2019 13:20
Show Gist options
  • Select an option

  • Save jemsgit/71c72ddcb59a4fbf2589ee75493dc8e0 to your computer and use it in GitHub Desktop.

Select an option

Save jemsgit/71c72ddcb59a4fbf2589ee75493dc8e0 to your computer and use it in GitHub Desktop.
//dev
const webpack = require('webpack');
const path = require('path');
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');
module.exports = {
devtool: 'inline-eval-source-map',
module: {
rules: [
{
test: /\.css$/,
use: [
require.resolve('style-loader'), // Inject CSS into the DOM.
require.resolve('css-loader'), // interprets @import and url() like import/require() and will resolve them.
require.resolve('postcss-loader') // loader for postcss
]
}
]
},
plugins: [
new CaseSensitivePathsPlugin(), //для правильного определения путей модулей (независимо от ОС)
new WatchMissingNodeModulesPlugin(path.join(process.cwd(), 'node_modules')), //ensures npm install <library> forces a project rebuild
new webpack.NamedModulesPlugin() //улучшает внешний вид имени модуля при Hot Module Replacement, который обновляет только изменившиеся части сборки
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment