How to use @vue/cli-service - 5 common examples

To help you get started, we’ve selected a few @vue/cli-service examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ditojs / dito / packages / server / src / controllers / AdminController.js View on Github external
getWebpackConfig() {
    // Use VueService to create full webpack config for us:
    const plugins = [{ id: '@vue/cli-plugin-babel', apply: vuePluginBabel }]
    if (this.config.build.eslint) {
      plugins.push({ id: '@vue/cli-plugin-eslint', apply: vuePluginEslint })
    }
    const service = new VueService(this.getPath('build'), {
      inlineOptions: this.getVueConfig(),
      plugins
    })
    service.init(this.mode)
    return service.resolveWebpackConfig()
  }
}
github storybookjs / vue-cli-plugin-storybook / generator / template / config / storybook / webpack.config.js View on Github external
// remove duplicated plugins
    plugins: merge({
      customizeArray: merge.unique(
        "plugins",
        [
          "HotModuleReplacementPlugin",
          "CaseSensitivePathsPlugin",
          "WatchMissingNodeModulesPlugin"
        ],
        plugin => plugin.constructor && plugin.constructor.name
      )
    })(vueConfig, storybookConfig).plugins,
    resolve: {
      ...vueConfig.resolve,
      alias: {
        ...vueConfig.resolve.alias,
        vue$: storybookConfig.resolve.alias.vue$
      }
    }
  };
};
github storybookjs / vue-cli-plugin-storybook / generator / template / config / storybook / webpack.config.js View on Github external
entry: storybookConfig.entry, // overwite entry
    output: storybookConfig.output, // overwrite output
    // remove duplicated plugins
    plugins: merge({
      customizeArray: merge.unique(
        "plugins",
        [
          "HotModuleReplacementPlugin",
          "CaseSensitivePathsPlugin",
          "WatchMissingNodeModulesPlugin"
        ],
        plugin => plugin.constructor && plugin.constructor.name
      )
    })(vueConfig, storybookConfig).plugins,
    resolve: {
      ...vueConfig.resolve,
      alias: {
        ...vueConfig.resolve.alias,
        vue$: storybookConfig.resolve.alias.vue$
      }
    }
  };
};
github lentoo / vue-cli-ssr-example / server / dev.ssr.js View on Github external
serverCompiler.watch({}, (err, stats) =>{
  if (err) {
    throw err
  }
  stats = stats.toJson()
  stats.errors.forEach(error => console.error(error) )
  stats.warnings.forEach( warn => console.warn(warn) )
  const bundlePath = path.join(
    webpackConfig.output.path,
    'vue-ssr-server-bundle.json'
  )
  bundle = JSON.parse(mfs.readFileSync(bundlePath,'utf-8'))
  console.log('new bundle generated')
})
github mathieutu / vue-cli-plugin-express / src / utils / serverUrl.js View on Github external
async findServerUrl (args, defaults) {
    const useHttps = coalesce(args.https, defaults.https);
    const protocol = useHttps ? 'https' : 'http';
    const host = coalesce(args.host, process.env.HOST, defaults.host);
    const port = await findPort(coalesce(args.port, process.env.PORT, defaults.port));
    const urls = prepareURLs(protocol, host, port);

    return {
      protocol,
      host,
      port,
      path,
      networkUrl: urls.lanUrlForTerminal,
      localUrl: format({ protocol, hostname: host, port, pathname: '/' }),
      localUrlForTerminal: urls.localUrlForTerminal,
      localUrlForBrowser: urls.localUrlForBrowser,
    };
  },
};

@vue/cli-service

local service for vue-cli projects

MIT
Latest version published 2 years ago

Package Health Score

71 / 100
Full package analysis