Skip to content

Conversation

@lionel-bijaoui
Copy link
Member

change name to "vfg" instead of "vue-form-generator" for the exported files.

Temporary fix for the ENV variable being undefined

… files.

Temporary fix for the ENV variable being undefined
package.json Outdated
"prebuild": "npm run test",
"build:core": "webpack --progress --config webpack.build.config.js --define process.env.FULL_BUNDLE=false --output-filename=vue-form-generator-core.js",
"build:full": "webpack --progress --config webpack.build.config.js --define process.env.FULL_BUNDLE=true",
"build:core": "webpack --progress --config webpack.build.config.js --define process.env.FULL_BUNDLE=false --output-filename=vfg-core.js",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change both build script to cross-env

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me explain a bit why i used cross-env. That way We have an explanation for later if I forget why i did that.

Here --define process.env.FULL_BUNDLE=false is the same as using webpack.DefinePlugin in the config.
By doing so, it make process.env.FULL_BUNDLE available in the code. What I didn't notice at first, is the it not yet defined in the config file.
So by using process.env.FULL_BUNDLE there, I get undefined. But by using cross-env, it is available in the config (but not in the code).
So I have to use both cross-env FULL_BUNDLE=true and --define process.env.FULL_BUNDLE=true to make it work.
This is a ugly temporary solution that will be fixed when the lib goes to webpack 2 one day.

Anyway, I added cross-env on both commands like you asked me in the next commit.

if (!process.env.FULL_BUNDLE) {
var cssFileName = "vue-form-generator-core.css";
var cssFileName;
console.warn(process.env.FULL_BUNDLE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove console message

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, removed

Copy link
Member

@icebob icebob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Mergeable.

@lionel-bijaoui lionel-bijaoui merged commit 1271c69 into vue-generators:master Feb 16, 2017
@lionel-bijaoui
Copy link
Member Author

Thanks

@lionel-bijaoui lionel-bijaoui deleted the change_name_export branch February 28, 2017 09:11
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

Successfully merging this pull request may close these issues.

2 participants