diff --git a/packages/netlify-cms-core/babel.config.js b/packages/netlify-cms-core/babel.config.js index f53b7c19..17b7744a 100644 --- a/packages/netlify-cms-core/babel.config.js +++ b/packages/netlify-cms-core/babel.config.js @@ -1,3 +1,4 @@ +const path = require('path'); const babelConfig = require('../../babel.config.js'); module.exports = { @@ -5,18 +6,18 @@ module.exports = { plugins: [ ...babelConfig.plugins, ['module-resolver', { - root: './src/components', + root: path.join(__dirname, 'src/components'), alias: { - src: './src', - Actions: './src/actions/', - Constants: './src/constants/', - Formats: './src/formats/', - Integrations: './src/integrations/', - Lib: './src/lib/', - Reducers: './src/reducers/', - Redux: './src/redux/', - Routing: './src/routing/', - ValueObjects: './src/valueObjects/', + src: path.join(__dirname, 'src'), + Actions: path.join(__dirname, 'src/actions/'), + Constants: path.join(__dirname, 'src/constants/'), + Formats: path.join(__dirname, 'src/formats/'), + Integrations: path.join(__dirname, 'src/integrations/'), + Lib: path.join(__dirname, 'src/lib/'), + Reducers: path.join(__dirname, 'src/reducers/'), + Redux: path.join(__dirname, 'src/redux/'), + Routing: path.join(__dirname, 'src/routing/'), + ValueObjects: path.join(__dirname, 'src/valueObjects/'), } }], ], diff --git a/packages/netlify-cms-core/webpack.config.js b/packages/netlify-cms-core/webpack.config.js index eb5c90a9..343ca50d 100644 --- a/packages/netlify-cms-core/webpack.config.js +++ b/packages/netlify-cms-core/webpack.config.js @@ -38,7 +38,7 @@ module.exports = { }, { test: /\.css$/, - include: [/redux-notifications/], + include: [/(redux-notifications|react-datetime)/], use: ['to-string-loader', 'css-loader'], }, ], diff --git a/packages/netlify-cms/src/backends.js b/packages/netlify-cms/src/backends.js index cfe96d99..687bd53e 100644 --- a/packages/netlify-cms/src/backends.js +++ b/packages/netlify-cms/src/backends.js @@ -1,9 +1,10 @@ -import cms from 'netlify-cms-core'; -import { GitHubBackend } from 'netlify-cms-backend-github'; -import { GitLabBackend } from 'netlify-cms-backend-gitlab'; -import { GitGatewayBackend } from 'netlify-cms-backend-git-gateway'; -import { TestBackend } from 'netlify-cms-backend-test'; +import cms from 'netlify-cms-core/src'; +import { GitHubBackend } from 'netlify-cms-backend-github/src'; +import { GitLabBackend } from 'netlify-cms-backend-gitlab/src'; +import { GitGatewayBackend } from 'netlify-cms-backend-git-gateway/src'; +import { TestBackend } from 'netlify-cms-backend-test/src'; +console.log(cms); const { registerBackend } = cms; registerBackend('git-gateway', GitGatewayBackend); diff --git a/packages/netlify-cms/src/editor-components.js b/packages/netlify-cms/src/editor-components.js index 194644b0..abb2b9fe 100644 --- a/packages/netlify-cms/src/editor-components.js +++ b/packages/netlify-cms/src/editor-components.js @@ -1,4 +1,5 @@ -import image from 'netlify-cms-editor-component-image'; +import cms from 'netlify-cms-core/src'; +import image from 'netlify-cms-editor-component-image/src'; const { registerEditorComponent } = cms; diff --git a/packages/netlify-cms/src/index.js b/packages/netlify-cms/src/index.js index ccf0cf51..542968f3 100644 --- a/packages/netlify-cms/src/index.js +++ b/packages/netlify-cms/src/index.js @@ -1,3 +1,6 @@ +import { init } from 'netlify-cms-core/src'; import './backends'; import './widgets'; import './editor-components'; + +init() diff --git a/packages/netlify-cms/src/widgets.js b/packages/netlify-cms/src/widgets.js index 228a8605..37a250ed 100644 --- a/packages/netlify-cms/src/widgets.js +++ b/packages/netlify-cms/src/widgets.js @@ -1,17 +1,17 @@ -import cms from 'netlify-cms-core'; -import { StringControl, StringPreview } from 'netlify-cms-widget-string'; -import { NumberControl, NumberPreview } from 'netlify-cms-widget-number'; -import { TextControl, TextPreview } from 'netlify-cms-widget-text'; -import { ImageControl, ImagePreview } from 'netlify-cms-widget-image'; -import { FileControl, FilePreview } from 'netlify-cms-widget-file'; -import { DateControl, DatePreview } from 'netlify-cms-widget-date'; -import { DateTimeControl, DateTimePreview } from 'netlify-cms-widget-datetime'; -import { SelectControl, SelectPreview } from 'netlify-cms-widget-select'; -import { MarkdownControl, MarkdownPreview } from 'netlify-cms-widget-markdown'; -import { ListControl, ListPreview } from 'netlify-cms-widget-list'; -import { ObjectControl, ObjectPreview } from 'netlify-cms-widget-object'; -import { RelationControl, RelationPreview } from 'netlify-cms-widget-relation'; -import { BooleanControl } from 'netlify-cms-widget-boolean'; +import cms from 'netlify-cms-core/src'; +import { StringControl, StringPreview } from 'netlify-cms-widget-string/src'; +import { NumberControl, NumberPreview } from 'netlify-cms-widget-number/src'; +import { TextControl, TextPreview } from 'netlify-cms-widget-text/src'; +import { ImageControl, ImagePreview } from 'netlify-cms-widget-image/src'; +import { FileControl, FilePreview } from 'netlify-cms-widget-file/src'; +import { DateControl, DatePreview } from 'netlify-cms-widget-date/src'; +import { DateTimeControl, DateTimePreview } from 'netlify-cms-widget-datetime/src'; +import { SelectControl, SelectPreview } from 'netlify-cms-widget-select/src'; +import { MarkdownControl, MarkdownPreview } from 'netlify-cms-widget-markdown/src'; +import { ListControl, ListPreview } from 'netlify-cms-widget-list/src'; +import { ObjectControl, ObjectPreview } from 'netlify-cms-widget-object/src'; +import { RelationControl, RelationPreview } from 'netlify-cms-widget-relation/src'; +import { BooleanControl } from 'netlify-cms-widget-boolean/src'; const { registerWidget } = cms; diff --git a/packages/netlify-cms/webpack.config.js b/packages/netlify-cms/webpack.config.js index 42edd361..3f5f472c 100644 --- a/packages/netlify-cms/webpack.config.js +++ b/packages/netlify-cms/webpack.config.js @@ -1,3 +1,8 @@ -const { getConfig } = require('../../scripts/webpack.js'); +const path = require('path'); +const coreWebpackConfig = require('../netlify-cms-core/webpack.config.js'); -module.exports = getConfig(); +module.exports = { + ...coreWebpackConfig, + context: path.join(__dirname, 'src'), + entry: './index.js', +};