chore: fix develop watch (#2237)
This commit is contained in:
parent
7987091196
commit
0b5d6d9c20
@ -6,18 +6,7 @@ const isTest = process.env.NODE_ENV === 'test';
|
||||
const isESM = process.env.NODE_ENV === 'esm';
|
||||
|
||||
const presets = () => {
|
||||
if (isTest) {
|
||||
return ['@babel/preset-react', '@babel/preset-env'];
|
||||
}
|
||||
return [
|
||||
'@babel/preset-react',
|
||||
[
|
||||
'@babel/preset-env',
|
||||
{
|
||||
modules: false,
|
||||
},
|
||||
],
|
||||
];
|
||||
return ['@babel/preset-react', '@babel/preset-env'];
|
||||
};
|
||||
|
||||
const plugins = () => {
|
||||
@ -33,6 +22,13 @@ const plugins = () => {
|
||||
'@babel/plugin-proposal-class-properties',
|
||||
'@babel/plugin-proposal-object-rest-spread',
|
||||
'@babel/plugin-proposal-export-default-from',
|
||||
[
|
||||
'emotion',
|
||||
{
|
||||
sourceMap: true,
|
||||
autoLabel: true,
|
||||
},
|
||||
],
|
||||
[
|
||||
'module-resolver',
|
||||
isESM
|
||||
@ -80,19 +76,6 @@ const plugins = () => {
|
||||
],
|
||||
];
|
||||
|
||||
if (isProduction) {
|
||||
return [
|
||||
...defaultPlugins,
|
||||
[
|
||||
'emotion',
|
||||
{
|
||||
hoist: true,
|
||||
autoLabel: true,
|
||||
},
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
if (isESM) {
|
||||
return [
|
||||
...defaultPlugins,
|
||||
@ -103,13 +86,6 @@ const plugins = () => {
|
||||
NETLIFY_CMS_CORE_VERSION: `${coreVersion}`,
|
||||
},
|
||||
],
|
||||
[
|
||||
'emotion',
|
||||
{
|
||||
hoist: true,
|
||||
autoLabel: true,
|
||||
},
|
||||
],
|
||||
[
|
||||
'inline-svg',
|
||||
{
|
||||
@ -132,27 +108,14 @@ const plugins = () => {
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
'emotion',
|
||||
{
|
||||
sourceMap: true,
|
||||
autoLabel: true,
|
||||
},
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
defaultPlugins.push('react-hot-loader/babel');
|
||||
return [
|
||||
...defaultPlugins,
|
||||
[
|
||||
'emotion',
|
||||
{
|
||||
sourceMap: true,
|
||||
autoLabel: true,
|
||||
},
|
||||
],
|
||||
];
|
||||
if (!isProduction) {
|
||||
defaultPlugins.push('react-hot-loader/babel');
|
||||
}
|
||||
|
||||
return defaultPlugins;
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
|
@ -1,9 +1,8 @@
|
||||
{
|
||||
"scripts": {
|
||||
"bootstrap": "lerna bootstrap",
|
||||
"start": "run-s clean bootstrap develop",
|
||||
"watch": "lerna run watch --parallel",
|
||||
"develop": "lerna run --parallel develop",
|
||||
"start": "run-s clean bootstrap build:esm develop",
|
||||
"develop": "lerna run develop --parallel",
|
||||
"build": "run-s clean build:esm build:lerna",
|
||||
"build:lerna": "lerna run build",
|
||||
"build:esm": "lerna run build:esm",
|
||||
|
@ -15,8 +15,7 @@
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"watch": "webpack -w",
|
||||
"develop": "npm run watch",
|
||||
"develop": "yarn build:esm --watch",
|
||||
"build": "cross-env NODE_ENV=production webpack",
|
||||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
|
||||
},
|
||||
|
@ -16,8 +16,7 @@
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"watch": "webpack -w",
|
||||
"develop": "npm run watch",
|
||||
"develop": "yarn build:esm --watch",
|
||||
"build": "cross-env NODE_ENV=production webpack",
|
||||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
|
||||
},
|
||||
|
@ -15,8 +15,7 @@
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"watch": "webpack -w",
|
||||
"develop": "npm run watch",
|
||||
"develop": "yarn build:esm --watch",
|
||||
"build": "cross-env NODE_ENV=production webpack",
|
||||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
|
||||
},
|
||||
|
@ -15,8 +15,7 @@
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"watch": "webpack -w",
|
||||
"develop": "npm run watch",
|
||||
"develop": "yarn build:esm --watch",
|
||||
"build": "cross-env NODE_ENV=production webpack",
|
||||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
|
||||
},
|
||||
|
@ -14,8 +14,7 @@
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"watch": "webpack -w",
|
||||
"develop": "npm run watch",
|
||||
"develop": "yarn build:esm --watch",
|
||||
"build": "cross-env NODE_ENV=production webpack",
|
||||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
|
||||
},
|
||||
|
@ -11,7 +11,7 @@
|
||||
"dist/"
|
||||
],
|
||||
"scripts": {
|
||||
"develop": "webpack -w",
|
||||
"develop": "yarn build:esm --watch",
|
||||
"build": "cross-env NODE_ENV=production webpack",
|
||||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
|
||||
},
|
||||
|
@ -15,8 +15,7 @@
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"watch": "webpack -w",
|
||||
"develop": "npm run watch",
|
||||
"develop": "yarn build:esm --watch",
|
||||
"build": "cross-env NODE_ENV=production webpack",
|
||||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
|
||||
},
|
||||
|
@ -15,8 +15,7 @@
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"watch": "webpack -w",
|
||||
"develop": "npm run watch",
|
||||
"develop": "yarn build:esm --watch",
|
||||
"build": "cross-env NODE_ENV=production webpack",
|
||||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
|
||||
},
|
||||
|
@ -16,8 +16,7 @@
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"watch": "webpack -w",
|
||||
"develop": "npm run watch",
|
||||
"develop": "yarn build:esm --watch",
|
||||
"build": "cross-env NODE_ENV=production webpack",
|
||||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
|
||||
},
|
||||
|
@ -12,8 +12,7 @@
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"watch": "webpack -w",
|
||||
"develop": "npm run watch",
|
||||
"develop": "yarn build:esm --watch",
|
||||
"build": "cross-env NODE_ENV=production webpack",
|
||||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
|
||||
},
|
||||
|
@ -20,8 +20,7 @@
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"watch": "webpack -w",
|
||||
"develop": "npm run watch",
|
||||
"develop": "yarn build:esm --watch",
|
||||
"build": "cross-env NODE_ENV=production webpack",
|
||||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
|
||||
},
|
||||
|
@ -18,8 +18,7 @@
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"watch": "webpack -w",
|
||||
"develop": "npm run watch",
|
||||
"develop": "yarn build:esm --watch",
|
||||
"build": "cross-env NODE_ENV=production webpack",
|
||||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
|
||||
},
|
||||
|
@ -12,8 +12,7 @@
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"watch": "webpack -w",
|
||||
"develop": "npm run watch",
|
||||
"develop": "yarn build:esm --watch",
|
||||
"build": "cross-env NODE_ENV=production webpack",
|
||||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
|
||||
},
|
||||
|
@ -16,8 +16,7 @@
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"watch": "webpack -w",
|
||||
"develop": "npm run watch",
|
||||
"develop": "yarn build:esm --watch",
|
||||
"build": "cross-env NODE_ENV=production webpack",
|
||||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
|
||||
},
|
||||
|
@ -17,8 +17,7 @@
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"watch": "webpack -w",
|
||||
"develop": "npm run watch",
|
||||
"develop": "yarn build:esm --watch",
|
||||
"build": "cross-env NODE_ENV=production webpack",
|
||||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
|
||||
},
|
||||
|
@ -9,3 +9,4 @@ const Widget = (opts = {}) => ({
|
||||
});
|
||||
|
||||
export const NetlifyCmsWidgetDate = { Widget, controlComponent, previewComponent };
|
||||
export { Widget as default, controlComponent, previewComponent };
|
||||
|
@ -18,8 +18,7 @@
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"watch": "webpack -w",
|
||||
"develop": "npm run watch",
|
||||
"develop": "yarn build:esm --watch",
|
||||
"build": "cross-env NODE_ENV=production webpack",
|
||||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
|
||||
},
|
||||
|
@ -9,3 +9,4 @@ const Widget = (opts = {}) => ({
|
||||
});
|
||||
|
||||
export const NetlifyCmsWidgetDatetime = { Widget, controlComponent, previewComponent };
|
||||
export { Widget as default, controlComponent, previewComponent };
|
||||
|
@ -18,8 +18,7 @@
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"watch": "webpack -w",
|
||||
"develop": "npm run watch",
|
||||
"develop": "yarn build:esm --watch",
|
||||
"build": "cross-env NODE_ENV=production webpack",
|
||||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
|
||||
},
|
||||
|
@ -18,8 +18,7 @@
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"watch": "webpack -w",
|
||||
"develop": "npm run watch",
|
||||
"develop": "yarn build:esm --watch",
|
||||
"build": "cross-env NODE_ENV=production webpack",
|
||||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
|
||||
},
|
||||
|
@ -17,8 +17,7 @@
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"watch": "webpack -w",
|
||||
"develop": "npm run watch",
|
||||
"develop": "yarn build:esm --watch",
|
||||
"build": "cross-env NODE_ENV=production webpack",
|
||||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
|
||||
},
|
||||
|
@ -17,8 +17,7 @@
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"watch": "webpack -w",
|
||||
"develop": "npm run watch",
|
||||
"develop": "yarn build:esm --watch",
|
||||
"build": "cross-env NODE_ENV=production webpack",
|
||||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
|
||||
},
|
||||
|
@ -17,8 +17,7 @@
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"watch": "webpack -w",
|
||||
"develop": "npm run watch",
|
||||
"develop": "yarn build:esm --watch",
|
||||
"build": "cross-env NODE_ENV=production webpack",
|
||||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
|
||||
},
|
||||
|
@ -16,8 +16,7 @@
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"watch": "webpack -w",
|
||||
"develop": "npm run watch",
|
||||
"develop": "yarn build:esm --watch",
|
||||
"build": "cross-env NODE_ENV=production webpack",
|
||||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
|
||||
},
|
||||
|
@ -18,8 +18,7 @@
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"watch": "webpack -w",
|
||||
"develop": "npm run watch",
|
||||
"develop": "yarn build:esm --watch",
|
||||
"build": "cross-env NODE_ENV=production webpack",
|
||||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
|
||||
},
|
||||
|
@ -17,8 +17,7 @@
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"watch": "webpack -w",
|
||||
"develop": "npm run watch",
|
||||
"develop": "yarn build:esm --watch",
|
||||
"build": "cross-env NODE_ENV=production webpack",
|
||||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
|
||||
},
|
||||
|
@ -18,8 +18,7 @@
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"watch": "webpack -w",
|
||||
"develop": "npm run watch",
|
||||
"develop": "yarn build:esm --watch",
|
||||
"build": "cross-env NODE_ENV=production webpack",
|
||||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
|
||||
},
|
||||
|
@ -16,8 +16,7 @@
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"watch": "webpack -w",
|
||||
"develop": "npm run watch",
|
||||
"develop": "yarn build:esm --watch",
|
||||
"build": "cross-env NODE_ENV=production webpack",
|
||||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
|
||||
},
|
||||
|
@ -19,8 +19,7 @@
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"watch": "webpack -w",
|
||||
"develop": "npm run watch",
|
||||
"develop": "yarn build:esm --watch",
|
||||
"build": "cross-env NODE_ENV=production webpack",
|
||||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
|
||||
},
|
||||
|
@ -11,8 +11,8 @@ import * as NetlifyCmsWidgetObject from 'netlify-cms-widget-object';
|
||||
import * as NetlifyCmsWidgetRelation from 'netlify-cms-widget-relation';
|
||||
import * as NetlifyCmsWidgetBoolean from 'netlify-cms-widget-boolean';
|
||||
import * as NetlifyCmsWidgetMap from 'netlify-cms-widget-map';
|
||||
import * as NetlifyCmsWidgetDate from 'netlify-cms-widget-date';
|
||||
import * as NetlifyCmsWidgetDateTime from 'netlify-cms-widget-datetime';
|
||||
import { NetlifyCmsWidgetDate } from 'netlify-cms-widget-date';
|
||||
import { NetlifyCmsWidgetDatetime } from 'netlify-cms-widget-datetime';
|
||||
|
||||
registerWidget(
|
||||
'string',
|
||||
@ -66,4 +66,4 @@ registerWidget(
|
||||
);
|
||||
registerWidget('boolean', NetlifyCmsWidgetBoolean.controlComponent);
|
||||
registerWidget('map', NetlifyCmsWidgetMap.controlComponent, NetlifyCmsWidgetMap.previewComponent);
|
||||
registerWidget([NetlifyCmsWidgetDate.Widget(), NetlifyCmsWidgetDateTime.Widget()]);
|
||||
registerWidget([NetlifyCmsWidgetDate.Widget(), NetlifyCmsWidgetDatetime.Widget()]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user