mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 15:13:21 +00:00
Merge branch 'fix/admin' of https://github.com/strapi/strapi into fix/admin
This commit is contained in:
commit
1d887250f4
@ -10,14 +10,33 @@ const webpack = require('webpack');
|
||||
const pkg = require(path.resolve(process.cwd(), 'package.json'));
|
||||
const pluginId = pkg.name.replace(/^strapi-/i, '');
|
||||
|
||||
const plugins = process.env.IS_ADMIN === 'true' ? fs.readdirSync(path.resolve(process.env.PWD, '..', 'plugins'))
|
||||
.filter(x => x[0] !== '.') : [];
|
||||
let noPlugin = false;
|
||||
let plugins = [];
|
||||
let pluginFolders = {};
|
||||
|
||||
const pluginFolders = plugins.reduce((acc, current) => {
|
||||
acc[current] = path.resolve(process.env.PWD, '..', 'plugins', current, 'node_modules', 'strapi-helper-plugin', 'lib', 'src');
|
||||
if (process.env.npm_lifecycle_event === 'start') {
|
||||
try {
|
||||
fs.accessSync(path.resolve(process.env.PWD, '..', 'plugins'), fs.constants.R_OK);
|
||||
} catch (e) {
|
||||
try {
|
||||
fs.accessSync(path.resolve(process.env.PWD, '..', 'api'), fs.constants.R_OK);
|
||||
|
||||
return acc;
|
||||
}, {});
|
||||
// Allow app without plugins.
|
||||
noPlugin = true;
|
||||
} catch (e) {
|
||||
throw new Error(`You need to start the WebPack server from the /admin directory in a Strapi's project.`);
|
||||
}
|
||||
}
|
||||
|
||||
plugins = process.env.IS_ADMIN === 'true' && !noPlugin ? fs.readdirSync(path.resolve(process.env.PWD, '..', 'plugins'))
|
||||
.filter(x => x[0] !== '.') : [];
|
||||
|
||||
pluginFolders = plugins.reduce((acc, current) => {
|
||||
acc[current] = path.resolve(process.env.PWD, '..', 'plugins', current, 'node_modules', 'strapi-helper-plugin', 'lib', 'src');
|
||||
|
||||
return acc;
|
||||
}, {});
|
||||
}
|
||||
|
||||
module.exports = (options) => ({
|
||||
entry: options.entry,
|
||||
|
||||
@ -14,21 +14,35 @@ const postcssReporter = require('postcss-reporter');
|
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
||||
const LodashModuleReplacementPlugin = require('lodash-webpack-plugin');
|
||||
|
||||
const plugins = process.env.IS_ADMIN === 'true' ? fs.readdirSync(path.resolve(process.env.PWD, '..', 'plugins'))
|
||||
.filter(x => x[0] !== '.') : [];
|
||||
let noPlugin = false;
|
||||
let plugins = [];
|
||||
let pluginFolders = {};
|
||||
|
||||
const pluginFolders = plugins.reduce((acc, current) => {
|
||||
acc[current] = path.resolve(process.env.PWD, '..', 'plugins', current, 'node_modules', 'strapi-helper-plugin', 'lib', 'src');
|
||||
if (process.env.npm_lifecycle_event === 'start') {
|
||||
try {
|
||||
fs.accessSync(path.resolve(process.env.PWD, '..', 'plugins'), fs.constants.R_OK);
|
||||
} catch (e) {
|
||||
try {
|
||||
fs.accessSync(path.resolve(process.env.PWD, '..', 'api'), fs.constants.R_OK);
|
||||
|
||||
return acc;
|
||||
}, {});
|
||||
// Allow app without plugins.
|
||||
noPlugin = true;
|
||||
} catch (e) {
|
||||
throw new Error(`You need to start the WebPack server from the /admin directory in a Strapi's project.`);
|
||||
}
|
||||
}
|
||||
|
||||
plugins = process.env.IS_ADMIN === 'true' && !noPlugin ? fs.readdirSync(path.resolve(process.env.PWD, '..', 'plugins'))
|
||||
.filter(x => x[0] !== '.') : [];
|
||||
|
||||
pluginFolders = plugins.reduce((acc, current) => {
|
||||
acc[current] = path.resolve(process.env.PWD, '..', 'plugins', current, 'node_modules', 'strapi-helper-plugin', 'lib', 'src');
|
||||
|
||||
return acc;
|
||||
}, {});
|
||||
}
|
||||
|
||||
const appPath = path.join(process.cwd(), 'admin', 'src', 'app.js')
|
||||
|
||||
const logger = require('../../server/logger');
|
||||
|
||||
const pkg = require(path.resolve(process.cwd(), 'package.json'));
|
||||
const dllPlugin = pkg.dllPlugin;
|
||||
const port = argv.port || process.env.PORT || 3000;
|
||||
|
||||
module.exports = require('./webpack.base.babel')({
|
||||
|
||||
@ -115,4 +115,4 @@
|
||||
"webpack-hot-middleware": "^2.18.2",
|
||||
"whatwg-fetch": "^2.0.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user