chore: output blank css files to avoid broken builds (#1724)

This commit is contained in:
Shawn Erquhart 2018-09-06 16:59:18 -04:00 committed by GitHub
parent a84ec97071
commit b58d6fe651
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 34 additions and 2 deletions

View File

@ -45,6 +45,7 @@
"netlify-cms-widget-text": "^2.0.5"
},
"devDependencies": {
"copy-webpack-plugin": "^4.5.2",
"cross-env": "^5.2.0",
"friendly-errors-webpack-plugin": "^1.7.0",
"webpack": "^4.16.1",

View File

@ -0,0 +1,5 @@
/**
* Netlify CMS 2.0 moved from static CSS to CSS-in-JS. Some site builds are configured to look
* for `cms.css`, and will break when it's missing, so we're putting out this blank file to help.
* We'll eventually remove it, so please update your build to not require it.
*/

View File

@ -1,6 +1,7 @@
const path = require('path');
const webpack = require('webpack');
const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const pkg = require('./package.json');
const { plugins } = require('../../scripts/webpack');
const coreWebpackConfig = require('../netlify-cms-core/webpack.config.js');
@ -24,6 +25,7 @@ const baseConfig = {
messages: ['Netlify CMS is now running at http://localhost:8080'],
},
}),
new CopyWebpackPlugin([{ from: '../shims/cms.css', to: 'dist/' }]),
],
devServer: {
contentBase: '../../dev-test',
@ -44,7 +46,7 @@ if (isProduction) {
*/
{
...baseConfig,
entry: [path.join(__dirname, 'scripts/deprecate-old-dist.js'), baseConfig.entry],
entry: [path.join(__dirname, 'shims/deprecate-old-dist.js'), baseConfig.entry],
output: {
...baseConfig.output,
filename: 'dist/cms.js',

View File

@ -2550,6 +2550,19 @@ copy-descriptor@^0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d"
copy-webpack-plugin@^4.5.2:
version "4.5.2"
resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-4.5.2.tgz#d53444a8fea2912d806e78937390ddd7e632ee5c"
dependencies:
cacache "^10.0.4"
find-cache-dir "^1.0.0"
globby "^7.1.1"
is-glob "^4.0.0"
loader-utils "^1.1.0"
minimatch "^3.0.4"
p-limit "^1.0.0"
serialize-javascript "^1.4.0"
core-js@^1.0.0:
version "1.2.7"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636"
@ -4258,6 +4271,17 @@ globby@^6.1.0:
pify "^2.0.0"
pinkie-promise "^2.0.0"
globby@^7.1.1:
version "7.1.1"
resolved "https://registry.yarnpkg.com/globby/-/globby-7.1.1.tgz#fb2ccff9401f8600945dfada97440cca972b8680"
dependencies:
array-union "^1.0.1"
dir-glob "^2.0.0"
glob "^7.1.2"
ignore "^3.3.5"
pify "^3.0.0"
slash "^1.0.0"
globby@^8.0.0:
version "8.0.1"
resolved "https://registry.yarnpkg.com/globby/-/globby-8.0.1.tgz#b5ad48b8aa80b35b814fc1281ecc851f1d2b5b50"
@ -6941,7 +6965,7 @@ p-finally@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae"
p-limit@^1.1.0:
p-limit@^1.0.0, p-limit@^1.1.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8"
dependencies: