Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build order for HtmlWebpackPlugin module? #133

Closed
danchristian opened this issue Jun 26, 2017 · 4 comments
Closed

Build order for HtmlWebpackPlugin module? #133

danchristian opened this issue Jun 26, 2017 · 4 comments

Comments

@danchristian
Copy link

Description

The /dist folder is in .gitignore so therefore empty, the build is then failing in production as CopyWebpackPlugin is looking in /dist for files to copy elsewhere but it errors with:

ERROR in [copy-webpack-plugin] unable to locate '/dist/app.html'

I would expect HtmlWebpackPlugin to build these files first before the CopyWebpackPlugin starts to look for them? Asking in the HtmlWebpackPlugin repo and it seems to possibly point to CopyWebpackPlugin using emit instead of after-compile?

Config

const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');

new HtmlWebpackPlugin({
    title: 'App',
    filename: 'app.html',
    template: './src/app.pug',
    inject: 'head',
    chunks: ['app'],
    hash: true
}),

new CopyWebpackPlugin([
    {from: 'dist/app.html',   to: '../Views/Shared/_layout.cshtml'}
])

Environment

Node.js v6.9.4
darwin 16.6.0
npm --version (3.10.10)
npm ls webpack (2.6.1)
npm ls html-webpack-plugin (2.28.0)
@garrensweet
Copy link

@danchristian Did you ever find a solution to this? I forked that repository and tried many, many things. I could not, however, get it to wait for the generated file to be completed before attempting the copy, however. I did try the after-compile tip that was suggested, to no avail.

@danchristian
Copy link
Author

@garrensweet Unfortunately not. I ended up taking the module out of our build process as it couldn't deliver what we needed.

@seotory
Copy link

seotory commented Sep 14, 2017

I'm gat same issue.
any updates?

@michael-ciniawsky
Copy link
Member

Duplicate of #15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants