mirror of
https://github.com/RoboSats/robosats.git
synced 2025-09-07 23:04:21 +00:00
Webpack fix
This commit is contained in:
@ -9,7 +9,6 @@ import fs from 'fs-extra';
|
|||||||
// Declare __dirname for TypeScript
|
// Declare __dirname for TypeScript
|
||||||
declare const __dirname: string;
|
declare const __dirname: string;
|
||||||
|
|
||||||
const sourceBuild = 'static/frontend';
|
|
||||||
const outputPaths: string[] = [
|
const outputPaths: string[] = [
|
||||||
path.resolve(__dirname, '../nodeapp/static'),
|
path.resolve(__dirname, '../nodeapp/static'),
|
||||||
path.resolve(__dirname, '../desktopApp/static'),
|
path.resolve(__dirname, '../desktopApp/static'),
|
||||||
@ -46,11 +45,11 @@ const configNode = (env: any, argv: { mode: string }): Configuration => {
|
|||||||
return {
|
return {
|
||||||
...config,
|
...config,
|
||||||
output: {
|
output: {
|
||||||
path: path.resolve(__dirname, sourceBuild),
|
path: path.resolve(__dirname, 'static/frontend'),
|
||||||
filename:
|
filename:
|
||||||
argv.mode === 'production' ? `main.v${version}.[contenthash].js` : `main.v${version}.js`,
|
argv.mode === 'production' ? `main.v${version}.[contenthash].js` : `main.v${version}.js`,
|
||||||
clean: true,
|
clean: true,
|
||||||
publicPath: '/' + sourceBuild,
|
publicPath: '/static/frontend/',
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
// Django
|
// Django
|
||||||
@ -142,7 +141,7 @@ const configNode = (env: any, argv: { mode: string }): Configuration => {
|
|||||||
compiler.hooks.afterEmit.tapAsync('CopyFilesPlugin', (_compilation, callback) => {
|
compiler.hooks.afterEmit.tapAsync('CopyFilesPlugin', (_compilation, callback) => {
|
||||||
Promise.all(
|
Promise.all(
|
||||||
outputPaths.map((outputPath) => {
|
outputPaths.map((outputPath) => {
|
||||||
const sourceDir = path.resolve(__dirname, sourceBuild);
|
const sourceDir = path.resolve(__dirname, 'static');
|
||||||
return fs
|
return fs
|
||||||
.copy(sourceDir, outputPath)
|
.copy(sourceDir, outputPath)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
Reference in New Issue
Block a user