Comparing version 9.2.2 to 9.2.3
@@ -63,2 +63,6 @@ var fs = require('fs') | ||
compiler.compile = function (content, filePath, cb) { | ||
var isProduction = process.env.NODE_ENV === 'production' | ||
var isServer = process.env.VUE_ENV === 'server' | ||
var isTest = !!process.env.VUEIFY_TEST | ||
// generate css scope id | ||
@@ -100,3 +104,3 @@ var id = 'data-v-' + genId(filePath) | ||
var style = resolvedParts.styles.join('\n') | ||
if (style) { | ||
if (style && !isServer) { | ||
// emit style | ||
@@ -131,3 +135,3 @@ compiler.emit('style', { | ||
if (template) { | ||
if (process.env.NODE_ENV !== 'production') { | ||
if (!isProduction && !isServer) { | ||
output += | ||
@@ -148,3 +152,3 @@ 'if (__vue__options__.functional) {console.error("' + | ||
// hot reload | ||
if (process.env.NODE_ENV !== 'production' && !process.env.VUEIFY_TEST) { | ||
if (!isProduction && !isTest && !isServer) { | ||
output += | ||
@@ -151,0 +155,0 @@ 'if (module.hot) {(function () {' + |
{ | ||
"name": "vueify", | ||
"version": "9.2.2", | ||
"version": "9.2.3", | ||
"description": "Vue component transform for Browserify", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -297,2 +297,10 @@ # vueify [![Build Status](https://circleci.com/gh/vuejs/vueify.svg?style=shield)](https://circleci.com/gh/vuejs/vueify) [![npm version](https://badge.fury.io/js/vueify.svg)](http://badge.fury.io/js/vueify) | ||
## Building for Production | ||
When building for production, follow these steps to ensure smaller bundle size: | ||
1. Make sure `process.env.NODE_ENV === "production"`. This tells `vueify` to avoid including hot-reload related code. | ||
2. Apply a global [envify](https://github.com/hughsk/envify) transform to your bundle. This allows the minifier to strip out all the warnings in Vue's source code wrapped in env variable conditional blocks. | ||
## Compiler API | ||
@@ -299,0 +307,0 @@ |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
38648
847
329