diff --git a/packages/netlify-cms/scripts/deprecate-old-dist.js b/packages/netlify-cms/scripts/deprecate-old-dist.js new file mode 100644 index 00000000..66da9f5a --- /dev/null +++ b/packages/netlify-cms/scripts/deprecate-old-dist.js @@ -0,0 +1 @@ +console.warn('The `cms.js` file is deprecated and will be removed in the next major release. Please use `netlify-cms.js` instead.'); diff --git a/packages/netlify-cms/webpack.config.js b/packages/netlify-cms/webpack.config.js index 3f5f472c..c19dd54b 100644 --- a/packages/netlify-cms/webpack.config.js +++ b/packages/netlify-cms/webpack.config.js @@ -1,8 +1,27 @@ const path = require('path'); const coreWebpackConfig = require('../netlify-cms-core/webpack.config.js'); -module.exports = { - ...coreWebpackConfig, - context: path.join(__dirname, 'src'), - entry: './index.js', -}; +module.exports = [ + { + ...coreWebpackConfig, + context: path.join(__dirname, 'src'), + entry: './index.js', + }, + + /** + * Output the same script a second time, but named `cms.js`, and with a + * deprecation notice. + */ + { + ...coreWebpackConfig, + context: path.join(__dirname, 'src'), + entry: [ + ...coreWebpackConfig.entry, + path.join(__dirname, 'scripts/deprecate-old-dist.js'), + ], + output: { + ...coreWebpackConfig.output, + filename: 'dist/cms.js', + }, + }, +]; diff --git a/website/content/docs/add-to-your-site.md b/website/content/docs/add-to-your-site.md index 7c3fe161..92619b86 100755 --- a/website/content/docs/add-to-your-site.md +++ b/website/content/docs/add-to-your-site.md @@ -30,7 +30,7 @@ admin └ config.yml ``` -The first file, `admin/index.html`, is the entry point for the Netlify CMS admin interface. This means that users can navigate to `yoursite.com/admin/` to access it. On the code side, it's a basic HTML starter page that loads the necessary CSS and JavaScript files. In this example, we pull those files from a public CDN: +The first file, `admin/index.html`, is the entry point for the Netlify CMS admin interface. This means that users can navigate to `yoursite.com/admin/` to access it. On the code side, it's a basic HTML starter page that loads the Netlify CMS JavaScript file. In this example, we pull the file from a public CDN: ```html @@ -39,14 +39,10 @@ The first file, `admin/index.html`, is the entry point for the Netlify CMS admin Content Manager - - - - - + ``` diff --git a/website/content/docs/custom-widgets.md b/website/content/docs/custom-widgets.md index f636966e..b13ebeea 100644 --- a/website/content/docs/custom-widgets.md +++ b/website/content/docs/custom-widgets.md @@ -45,7 +45,7 @@ CMS.registerWidget(name, control, [preview]); **Example:** ```html - + + + @@ -69,7 +69,7 @@ Registers a template for a collection. **Example:** ```html - + +