49 lines
1.2 KiB
JavaScript
Raw Normal View History

2018-07-17 19:13:52 -04:00
const path = require('path');
const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin');
2018-07-23 21:25:49 -04:00
const { getConfig, rules, plugins } = require('../../scripts/webpack.js');
2018-07-17 19:13:52 -04:00
module.exports = {
2018-07-23 21:25:49 -04:00
...getConfig(),
2018-07-17 19:13:52 -04:00
context: path.join(__dirname, 'src'),
entry: './index.js',
module: {
2018-07-23 12:30:15 -04:00
rules: [
2018-07-23 21:25:49 -04:00
...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'),
},
},
},
2018-07-23 12:30:15 -04:00
{
test: /\.css$/,
include: [/redux-notifications/],
use: ['to-string-loader', 'css-loader'],
},
],
2018-07-17 19:13:52 -04:00
},
plugins: [
2018-07-23 21:25:49 -04:00
...Object.entries(plugins)
.filter(([ key ]) => key !== 'friendlyErrors')
.map(([ _, plugin ]) => plugin()),
2018-07-17 19:13:52 -04:00
new FriendlyErrorsWebpackPlugin({
compilationSuccessInfo: {
messages: ['Netlify CMS is now running at http://localhost:8080'],
},
}),
],
2018-07-23 21:25:49 -04:00
devServer: {
contentBase: './example',
watchContentBase: true,
quiet: true,
host: 'localhost',
port: 8080,
},
2018-07-17 19:13:52 -04:00
};