mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-25 15:40:06 +03:00
Keep going
This commit is contained in:
parent
6ebcca5dab
commit
3a905d6153
|
@ -21,7 +21,25 @@ await esbuild.build({
|
|||
'.pug': 'empty',
|
||||
'.woff2': 'file',
|
||||
},
|
||||
// TODO Define process.env.NODE_ENV and process.env.BABEL_ENV
|
||||
define: {
|
||||
'process.env.NODE_ENV': '"production"',
|
||||
'process.env.BABEL_ENV': '"production"',
|
||||
},
|
||||
});
|
||||
|
||||
await esbuild.build({
|
||||
entryPoints: [{ out: 'pagewrap.bundle', in: 'src/pageScriptWrap.ts' }],
|
||||
bundle: true,
|
||||
logLevel: 'info',
|
||||
outdir: 'dist',
|
||||
minify: true,
|
||||
loader: {
|
||||
'.js': 'text',
|
||||
},
|
||||
define: {
|
||||
'process.env.NODE_ENV': '"production"',
|
||||
'process.env.BABEL_ENV': '"production"',
|
||||
},
|
||||
});
|
||||
|
||||
console.log('Creating HTML files...');
|
||||
|
@ -39,6 +57,8 @@ fs.copyFileSync('chrome/manifest.json', 'dist/manifest.json');
|
|||
console.log('Copying assets...');
|
||||
fs.cpSync('src/assets', 'dist', { recursive: true });
|
||||
|
||||
// TODO Copy dist to each browser directory
|
||||
|
||||
// TODO Babel?
|
||||
|
||||
// TODO Remember ot run TypeScript
|
||||
// TODO Remember to run TypeScript
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import script from '../dist/page.bundle.js';
|
||||
|
||||
let s = document.createElement('script');
|
||||
s.type = 'text/javascript';
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
const { default: script } = require('raw-loader!../dist/page.bundle.js');
|
||||
s.appendChild(document.createTextNode(script));
|
||||
(document.head || document.documentElement).appendChild(s);
|
||||
s.parentNode!.removeChild(s);
|
||||
|
|
Loading…
Reference in New Issue
Block a user