add netlify-cms (main) package

This commit is contained in:
Shawn Erquhart
2018-07-23 23:40:48 -04:00
parent 19f484eeda
commit 27d13a73b6
18 changed files with 115 additions and 70 deletions

View File

@ -24,24 +24,9 @@ const rules = () => ({
});
const plugins = () => {
const defaultPlugins = {
return {
friendlyErrors: () => new FriendlyErrorsWebpackPlugin()
};
if (isProduction) {
return {
...defaultPlugins,
sourcemap: (config = {}) => new webpack.SourceMapDevToolPlugin({
filename: '[file].map',
moduleFilenameTemplate: info => path.posix.normalize(`../src/${info.resourcePath}`),
noSources: true,
}),
};
}
return {
...defaultPlugins,
}
};
const stats = () => {
@ -75,7 +60,7 @@ const getConfig = () => ({
rules: Object.values(rules()).map(rule => rule()),
},
plugins: Object.values(plugins()).map(plugin => plugin),
devtool: !isProduction && 'source-map',
devtool: 'source-map',
target: 'web',
/**