Vishal0203/file-include-webpack-plugin

Error on source path

Closed this issue · 8 comments

@Vishal0203 I'm setting up my webpack config file like this:

new FileIncludeWebpackPlugin({
      source: './src/views'
    }),

My error is:

Error: ENOENT: no such file or directory, mkdir '/Users/evan/Documents/Projects/my-framework/dist/partials'

However, if I make my webpack config:

new FileIncludeWebpackPlugin({
      source: './src2/views'
    }),

My error is:

Error: ENOENT: no such file or directory, mkdir '/Users/evan/Documents/Projects/my-framework/src2/partials'

Is this meant to work with webpack dev server ?

Hi @evandiamond
I think I'll need more details. Could you please show me your webpack config and your directory structure?

Is this meant to work with webpack dev server?

Ideally, yes (I haven't tried that ye, will give it a shot) because it ultimately just runs webpack in watch mode, which I'm doing using this command.

Hi @evandiamond
I tried to replicate the behavior and also added webpack-dev-server to the examples.
The plugin seems to work fine.

Please refer example: example
run the example using npm run dev.

Closing the issue for now. Please re-open if necessary.

Thanks.

b1nj commented

Bonjour,

I have the same problem with the example in this project.

Error: ENOENT: no such file or directory, mkdir '/home/file-include-webpack-plugin/example/dist/home'

So i create folder 'dist'.
And now :

Error: EEXIST: file already exists, mkdir '/home/file-include-webpack-plugin/example/dist'

I do just :
npm install
npm run dev

npm -v : 6.9.0
node - v : v9.8.0

b1nj commented

I update node. It's ok now.

Minimal node version is v10.12.0 for this webpack module. See history in function https://nodejs.org/api/fs.html#fs_fs_mkdirsync_path_options

b1nj commented

Same bug in Windows.

There are a problem with the path separation.

I write a fix : #5

@b1nj Thanks for the fix 👍
the fix is available as part of v1.2.0

I've also added node version to package.json as a quick indication for now.
Will be happy to make it compatible to >=8.0 will work on that and make a new release.

b1nj commented

Thanks