Fixed deploy script

This commit is contained in:
Brian Vaughn
2019-05-03 08:55:31 -07:00
parent 07281993d1
commit 435e22ad1b
6 changed files with 39 additions and 17 deletions
+3 -2
View File
@@ -61,7 +61,8 @@
<div id="devtools"></div>
<!-- This script installs the hook, injects the backend, and renders the DevTools UI -->
<!-- It's served by webpack dev server and doesn't exist on disk -->
<script src="devtools.js"></script>
<!-- In DEV mode, this file is served by the Webpack dev server -->
<!-- For production builds, it's built by Webpack and uploaded from the local file system -->
<script src="dist/devtools.js"></script>
</body>
</html>
+1 -1
View File
@@ -1,5 +1,5 @@
{
"name": "react-devtools-experimental",
"alias": ["react-devtools-experimental"],
"files": ["index.html", "build"]
"files": ["index.html", "dist"]
}
+6 -4
View File
@@ -38,7 +38,7 @@ mountButton.addEventListener('click', function() {
}
});
inject('./app.js', () => {
inject('dist/app.js', () => {
initDevTools({
connect(cb) {
const bridge = new Bridge({
@@ -78,9 +78,11 @@ inject('./app.js', () => {
// Initialize the backend only once the DevTools frontend Store has been initialized.
// Otherwise the Store may miss important initial tree op codes.
inject('./backend.js', () => {
// Clear noisy webpack "WDS: ..." output.
console.clear();
inject('dist/backend.js', () => {
if (__DEV__) {
// Clear noisy webpack "WDS: ..." output.
console.clear();
}
});
});
},
+24 -7
View File
@@ -8,20 +8,20 @@ if (!NODE_ENV) {
process.exit(1);
}
const TARGET = process.env.TARGET;
if (!TARGET) {
console.error('TARGET not set');
process.exit(1);
}
const __DEV__ = NODE_ENV === 'development';
const GITHUB_URL = getGitHubURL();
const DEVTOOLS_VERSION = getVersionString();
module.exports = {
const config = {
mode: __DEV__ ? 'development' : 'production',
devtool: false,
devServer: {
hot: true,
port: 8080,
clientLogLevel: 'warning',
stats: 'errors-only',
},
entry: {
app: './app/index.js',
backend: './src/backend.js',
@@ -67,3 +67,20 @@ module.exports = {
],
},
};
if (TARGET === 'local') {
config.devServer = {
hot: true,
port: 8080,
clientLogLevel: 'warning',
publicPath: '/dist/',
stats: 'errors-only',
};
} else {
config.output = {
path: resolve(__dirname, 'dist'),
filename: '[name].js',
};
}
module.exports = config;