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

Unable to set path for generated global.js #16

Open
vishald256 opened this issue Nov 9, 2020 · 0 comments
Open

Unable to set path for generated global.js #16

vishald256 opened this issue Nov 9, 2020 · 0 comments

Comments

@vishald256
Copy link

Webpack is trying to create global.js but unable write in dist directory, Could you please help ?

`> webpack -p

Hash: b342fc17defde21ea4cf
Version: webpack 3.12.0
Time: 15238ms
Asset Size Chunks Chunk Names
images/placeholder.jpg 97.5 kB [emitted]
images/loading-icon.gif 84.9 kB [emitted]
app.js 705 kB 0 [emitted] [big] app
style.css 1.2 kB 0 [emitted] app
[17] ./src/not-found.jsx 3.98 kB {0} [built]
[24] (webpack)/buildin/global.js 509 bytes {0} [built]
[47] ./src/elements/category.jsx 4.61 kB {0} [built]
[90] ./src/index.jsx 11.4 kB {0} [built]
[211] ./src/header.jsx 8.96 kB {0} [built]
[233] ./src/footer.jsx 7.32 kB {0} [built]
[238] ./src/posts.jsx 5.92 kB {0} [built]
[301] ./src/post.jsx 6.17 kB {0} [built]
[302] ./src/author.jsx 4.51 kB {0} [built]
[303] ./src/about-us.jsx 4.74 kB {0} [built]
[310] ./src/careers.jsx 2.83 kB {0} [built]
[311] ./src/e-waste.jsx 13.2 kB {0} [built]
[312] ./src/page.jsx 8.49 kB {0} [built]
[313] ./src/home.jsx 6.25 kB {0} [built]
[338] ./src/style.scss 41 bytes {0} [built]
+ 324 hidden modules
Child extract-text-webpack-plugin node_modules/extract-text-webpack-plugin/dist node_modules/css-loader/index.js!node_modules/sass-loader/dist/cjs.js!src/style.scss:
[0] ./node_modules/css-loader!./node_modules/sass-loader/dist/cjs.js!./src/style.scss 1.36 kB {0} [built]
+ 1 hidden module`

Here is Webpack configuration,
`var ExtractTextPlugin = require("extract-text-webpack-plugin");
var path = require("path");

module.exports = {
entry: {
app: "./src/index.jsx"
},
output: {
path: path.resolve(__dirname, "dist"),
filename: "[name].js"
},
module: {
rules: [
{
test: /.scss$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: ["css-loader", "sass-loader"],
publicPath: "dist"
})
},
{
test: /.jsx?$/,
exclude: /node_modules/,
use: "babel-loader"
},
{
test: path.resolve('./src/globals.js'),
use:
'exports-loader?type=commonjs&exports[]=file&exports[]=multiple|helpers.parse|parse',
},
{
test: /.(jpe?g|png|gif|svg)$/i,
use: [
"file-loader?name=[name].[ext]&outputPath=images/&publicPath=http://servifyinwp.com/wp-content/themes/servify-feb-2020/dist/images",
"image-webpack-loader"
]
},
{
test: /.(woff2?|svg)$/,
loader: "url-loader?limit=10000&name=fonts/[name].[ext]"
},
{
test: /.(ttf|eot)$/,
loader: "file-loader?name=fonts/[name].[ext]"
}
]
},
resolve: {
extensions: [".js", ".jsx"]
},
plugins: [
new ExtractTextPlugin({
filename: "style.css",
allChunks: true
})
]
};
`

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

1 participant