unbroken-dome / indexhtml-webpack-plugin

Index HTML plugin for Webpack
MIT License
42 stars 5 forks source link

Cannot find dependencies/sourceChunk for entry with absolute path #16

Closed Bartozzz closed 6 years ago

Bartozzz commented 8 years ago

node.js version : v6.2.1 webpack version : latest indexhtml-webpack-plugin version : latest

Context:

I am trying to build a single-page application using Webpack and indexhtml-webpack-plugin. The file I am trying to compile is in another directory that the current working directory.

Issue:

const path              = require( "path" );
const webpack           = require( "webpack" );
const IndexHtmlPlugin   = require( "indexhtml-webpack-plugin" );

module.exports = {
    //context : "/Users/Bartek/ProjectName/_temp",

    entry : {
        "index.html" : "/Users/Bartek/ProjectName/_temp/app/index.html"
    },

    module : {
        loaders : [
            { test : /\.html$/, loader : "html?attrs=link:href" }
        ]
    },

    plugins : [
        new IndexHtmlPlugin( "index.html", "index.html" )
    ],

    output : {
        path        : path.resolve( "dist" ),
        filename    : "[name].js"
    }
};
Bartozzz commented 8 years ago

Do you have a working demo with the context option set?