Closed karlas closed 9 years ago
By setting:
options : '../../webpack.config.js'
Error is :
Error: Configuration not found at ../../webpack.config.js
and setting
options : '.webpack.config.js'
Error is the same "Invalid path" error. So I guess path is relative from root of project
Indeed, path is relative to process.cwd()
, could be confusing.
Maybe I should allow only absolute path...
Thanks for you time!
Unfortunately i'm getting same error (Invalid path "") and same trace.
Any clue?
Can you share your webpack.config.js
file?
Sure :
// webpack.config.js
var webpack = require('webpack');
var path = require('path');
var isDev = (process.env.NODE_ENV === 'dev');
var config =
{
entry : {sobrassada : './client_js/sobrassada/main.js'},
devtool : isDev ? 'source-map' : false,
output : isDev ? {filename: './public/sobrassada.js'} :
{
path : './public/',
publicPath : './public/',
chunkFilename : '[name].js',
filename : '[name].js'
},
module:
{
loaders:
[
{
test : /\.jsx?$/,
exclude : /(node_modules)/,
loader : isDev ? 'react-hot!babel!eslint-loader' : 'babel'
},
{
test : /\.less$/,
loader : "style!css!less"
},
//Fonts
{
test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
loader: "url?limit=10000&mimetype=application/font-woff"
},
{
test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/,
loader: "url?limit=10000&mimetype=application/font-woff"
},
{
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
loader: "url?limit=10000&mimetype=application/octet-stream"
},
{
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
loader: "file"
},
{
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
loader: "url?limit=10000&mimetype=image/svg+xml"
}
]
},
plugins:
[
new webpack.DefinePlugin(
{
'process.env' : {'NODE_ENV': JSON.stringify(process.env.NODE_ENV)},
__DEV__ : isDev,
}),
]
};
if (isDev)
{
config.plugins.push(new webpack.HotModuleReplacementPlugin());
config.eslint = {configFile: '.eslintrc'};
}
module.exports = config;
Ok, I am pretty sure it has nothing to do with the plugin. However in your config file I can see that output.path
is not absolute, and it should be.
The output directory as absolute path (required).
Correct ;)
In fact, in dev mode i was noy specyficing any path, just filename.
Thanks!
No problem.
Hi,
I'm experiencing this error, and I can't guess how to solve it.
Error trace is:
This appears some seconds after registering, not inmediately. Register code is, at /src/server/index.js file of my project
Webpack-dev-server is working fine when executing standalone via terminal. Could the problem be to have files in different paths? (webpack.config.js is at root of project)
Thanks in advance