Commit b8590185 authored by Jure's avatar Jure

revert: revert some breaking changes in terms of organization

parent 3f8317c3
......@@ -5,6 +5,6 @@
</head>
<body>
<div id="root"></div>
<script type="text/javascript" charset="utf-8" src="/assets/app.js"></script>
<script type="text/javascript" charset="utf-8" src="/assets/js/bundle.js"></script>
</body>
</html>
const { deferConfig } = require('config/defer')
module.exports = {
'pubsweet-server': {
db: {
database: 'starter',
},
baseUrl: deferConfig(
cfg => `http://localhost:${cfg['pubsweet-server'].port}`,
),
baseUrl: `http://localhost:4000`,
morganLogFormat:
':method :url :status :graphql[operation] :res[content-length] :response-time ms',
},
......
......@@ -5,14 +5,14 @@ module.exports = {
'pubsweet-server': {
db: { database: 'test' },
logger,
port: 4000,
baseUrl: 'http://localhost:4000',
port: 3000,
baseUrl: 'http://localhost:3000',
secret: 'test',
},
mailer: {
path: path.join(__dirname, 'mailer_test.js'),
},
'password-reset': {
url: 'http://localhost:4000/password-reset',
url: 'http://localhost:3000/password-reset',
},
}
......@@ -17,7 +17,7 @@ module.exports = (opts = {}) => {
plugins.push(
new HtmlWebpackPlugin({
title: 'PubSweet Starter App',
template: '../client/index.ejs', // Load a custom template
template: '../app/index.ejs', // Load a custom template
}),
)
}
......
......@@ -4,7 +4,7 @@ const config = require('config')
const { pick } = require('lodash')
const rules = require('./common-rules')
const contentBase = path.resolve(__dirname, '..', 'client', 'dist')
const contentBase = path.resolve(__dirname, '..', '_build', 'assets')
// can't use node-config in webpack so save whitelisted client config into the build and alias it below
const clientConfig = pick(config, config.publicKeys)
......@@ -19,7 +19,7 @@ module.exports = webpackEnv => {
const isEnvProduction = webpackEnv === 'production'
return {
devServer: {
port: 9000,
port: 4000,
hot: true,
contentBase: path.join(contentBase, 'public'),
publicPath: '/',
......@@ -32,7 +32,7 @@ module.exports = webpackEnv => {
name: 'client application',
target: 'web',
mode: webpackEnv,
context: path.join(__dirname, '..', 'client'),
context: path.join(__dirname, '..', 'app'),
entry: {
app: isEnvDevelopment ? ['react-hot-loader/patch', './app'] : ['./app'],
},
......@@ -40,14 +40,14 @@ module.exports = webpackEnv => {
path: contentBase,
publicPath: '/',
filename: isEnvProduction
? 'static/js/[name].[contenthash:8].js'
: isEnvDevelopment && 'static/js/bundle.js',
? 'js/[name].[contenthash:8].js'
: isEnvDevelopment && 'js/bundle.js',
// TODO: remove this when upgrading to webpack 5
futureEmitAssets: true,
// There are also additional JS chunk files if you use code splitting.
chunkFilename: isEnvProduction
? 'static/js/[name].[contenthash:8].chunk.js'
: isEnvDevelopment && 'static/js/[name].chunk.js',
? 'js/[name].[contenthash:8].chunk.js'
: isEnvDevelopment && 'js/[name].chunk.js',
},
devtool: 'cheap-module-source-map',
module: {
......
module.exports = require('./webpack.config.js')('production')
module.exports = require('./webpack.config.js')('development')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment