Skip to content

Commit

Permalink
fix: output generation in subfolders
Browse files Browse the repository at this point in the history
fix: output generation in subfolders
  • Loading branch information
matteobertoldo committed Oct 16, 2023
2 parents 47f79e4 + 5f90768 commit 3374523
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/webpack-mjml-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const packageJSON = require('../package');
const webpack = require('webpack');
const { RawSource } = webpack.sources;
const { NoSourceFilesWarning, BeautifyOptionDeprecated, MinifyOptionDeprecated, ErrorsMJMLParsing } = require('./errors/');
const { basename } = require('path');
const { basename, relative } = require('path');

/**
* @param {string} inputPath The path where `.mjml` files are located.
Expand Down Expand Up @@ -49,7 +49,7 @@ WebpackMjmlStore.prototype.apply = function (compiler) {
compilation.fileDependencies.add(file);

const data = await that.convertFile(file, outputFile);
compilation.emitAsset(basename(outputFile), new RawSource(data.response), {
compilation.emitAsset(relative(compilation.outputOptions.path, outputFile), new RawSource(data.response), {
immutable: data.response === data.readable,
javascriptModule: false
});
Expand Down

0 comments on commit 3374523

Please sign in to comment.