yeoman / configstore

Easily load and persist config without having to think about where and how
BSD 2-Clause "Simplified" License
866 stars 57 forks source link

Cannot build with webpack #53

Closed safinn closed 7 years ago

safinn commented 7 years ago

Im using this module in a react app and when trying to bundle the code with webpack in production mode I get an error due to this line:

const defaultPathMode = 0o0700;

with the text Invalid syntax. Should the value be a string (surrounded by quotes)?

sindresorhus commented 7 years ago

That's a ES2015 octal literal. This module mainly targets Node.js, not the browser. It's up to you to transpile it with Babel if you want to use it in the browser. You can find a more detailed explanation here: https://github.com/sindresorhus/ama/issues/446

sindresorhus commented 7 years ago

In this case, the proper way would be to tell webpack to ignore it. See: https://github.com/sindresorhus/electron-config/issues/3