improve interpackage config sharing
This commit is contained in:
23
packages/netlify-cms-core/babel.config.js
Normal file
23
packages/netlify-cms-core/babel.config.js
Normal file
@ -0,0 +1,23 @@
|
||||
const babelConfig = require('../../babel.config.js');
|
||||
|
||||
module.exports = {
|
||||
...babelConfig,
|
||||
plugins: [
|
||||
...babelConfig.plugins,
|
||||
['module-resolver', {
|
||||
root: './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/',
|
||||
}
|
||||
}],
|
||||
],
|
||||
};
|
@ -1,5 +1,5 @@
|
||||
import { actions as notifActions } from 'redux-notifications';
|
||||
import { currentBackend } from 'Backends/backend';
|
||||
import { currentBackend } from 'src/backend';
|
||||
|
||||
const { notifSend } = notifActions;
|
||||
|
||||
|
@ -2,7 +2,7 @@ import uuid from 'uuid/v4';
|
||||
import { actions as notifActions } from 'redux-notifications';
|
||||
import { BEGIN, COMMIT, REVERT } from 'redux-optimist';
|
||||
import { serializeValues } from 'Lib/serializeEntryValues';
|
||||
import { currentBackend } from 'Backends/backend';
|
||||
import { currentBackend } from 'src/backend';
|
||||
import { getAsset } from 'Reducers';
|
||||
import { selectFields } from 'Reducers/collections';
|
||||
import { status, EDITORIAL_WORKFLOW } from 'Constants/publishModes';
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { fromJS, List, Set } from 'immutable';
|
||||
import { actions as notifActions } from 'redux-notifications';
|
||||
import { serializeValues } from 'Lib/serializeEntryValues';
|
||||
import { currentBackend } from 'Backends/backend';
|
||||
import { currentBackend } from 'src/backend';
|
||||
import { getIntegrationProvider } from 'Integrations';
|
||||
import { getAsset, selectIntegration } from 'Reducers';
|
||||
import { selectFields } from 'Reducers/collections';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { actions as notifActions } from 'redux-notifications';
|
||||
import { currentBackend } from 'Backends/backend';
|
||||
import { currentBackend } from 'src/backend';
|
||||
import { createAssetProxy } from 'ValueObjects/AssetProxy';
|
||||
import { getAsset, selectIntegration } from 'Reducers';
|
||||
import { getIntegrationProvider } from 'Integrations';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import fuzzy from 'fuzzy';
|
||||
import { currentBackend } from 'Backends/backend';
|
||||
import { currentBackend } from 'src/backend';
|
||||
import { getIntegrationProvider } from 'Integrations';
|
||||
import { selectIntegration, selectEntries } from 'Reducers';
|
||||
import { selectInferedField } from 'Reducers/collections';
|
||||
|
@ -9,7 +9,7 @@ import { Notifs } from 'redux-notifications';
|
||||
import TopBarProgress from 'react-topbar-progress-indicator';
|
||||
import { loadConfig as actionLoadConfig } from 'Actions/config';
|
||||
import { loginUser as actionLoginUser, logoutUser as actionLogoutUser } from 'Actions/auth';
|
||||
import { currentBackend } from 'Backends/backend';
|
||||
import { currentBackend } from 'src/backend';
|
||||
import { showCollection, createNewEntry } from 'Actions/collections';
|
||||
import { openMediaLibrary as actionOpenMediaLibrary } from 'Actions/mediaLibrary';
|
||||
import MediaLibrary from 'MediaLibrary/MediaLibrary';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { resolvePath } from 'netlify-cms-lib-util';
|
||||
import { currentBackend } from 'Backends/backend';
|
||||
import { currentBackend } from 'src/backend';
|
||||
import { getIntegrationProvider } from 'Integrations';
|
||||
import { selectIntegration } from 'Reducers';
|
||||
|
||||
|
@ -1,14 +1,26 @@
|
||||
const path = require('path');
|
||||
const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin');
|
||||
const baseConfig = require('../../webpack.config.js');
|
||||
const { getConfig, rules, plugins } = require('../../scripts/webpack.js');
|
||||
|
||||
module.exports = {
|
||||
...baseConfig,
|
||||
...getConfig(),
|
||||
context: path.join(__dirname, 'src'),
|
||||
entry: './index.js',
|
||||
module: {
|
||||
rules: [
|
||||
...baseConfig.module.rules,
|
||||
...Object.entries(rules)
|
||||
.filter(([ key ]) => key !== 'js')
|
||||
.map(([ _, rule ]) => rule()),
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
configFile: path.join(__dirname, 'babel.config.js'),
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
include: [/redux-notifications/],
|
||||
@ -16,6 +28,16 @@ module.exports = {
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
...Object.entries(plugins)
|
||||
.filter(([ key ]) => key !== 'friendlyErrors')
|
||||
.map(([ _, plugin ]) => plugin()),
|
||||
new FriendlyErrorsWebpackPlugin({
|
||||
compilationSuccessInfo: {
|
||||
messages: ['Netlify CMS is now running at http://localhost:8080'],
|
||||
},
|
||||
}),
|
||||
],
|
||||
devServer: {
|
||||
contentBase: './example',
|
||||
watchContentBase: true,
|
||||
@ -23,12 +45,4 @@ module.exports = {
|
||||
host: 'localhost',
|
||||
port: 8080,
|
||||
},
|
||||
plugins: [
|
||||
...baseConfig.plugins.filter(plugin => !plugin instanceof FriendlyErrorsWebpackPlugin),
|
||||
new FriendlyErrorsWebpackPlugin({
|
||||
compilationSuccessInfo: {
|
||||
messages: ['Netlify CMS is now running at http://localhost:8080'],
|
||||
},
|
||||
}),
|
||||
],
|
||||
};
|
||||
|
Reference in New Issue
Block a user