const path = require('path'); const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin'); const { getConfig, rules, plugins } = require('../../scripts/webpack.js'); module.exports = { ...getConfig(), context: path.join(__dirname, 'src'), entry: './index.js', module: { rules: [ ...Object.entries(rules) .filter(([ key ]) => key !== 'js') .map(([ _, rule ]) => rule()), { test: /\.js$/, exclude: /node_modules/, use: { loader: 'babel-loader', options: { configFile: path.join(__dirname, 'babel.config.js'), }, }, }, { test: /\.css$/, include: [/redux-notifications/], use: ['to-string-loader', 'css-loader'], }, ], }, plugins: [ ...Object.entries(plugins) .filter(([ key ]) => key !== 'friendlyErrors') .map(([ _, plugin ]) => plugin()), new FriendlyErrorsWebpackPlugin({ compilationSuccessInfo: { messages: ['Netlify CMS is now running at http://localhost:8080'], }, }), ], devServer: { contentBase: './example', watchContentBase: true, quiet: true, host: 'localhost', port: 8080, }, };