How to use the @angular/service-worker/webpack.default function in @angular/service-worker

To help you get started, we’ve selected a few @angular/service-worker 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 HelixOne / leto / webpack.config.aot.js View on Github external
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ForkCheckerPlugin = require('awesome-typescript-loader').ForkCheckerPlugin;
const ClosureCompiler = require('google-closure-compiler-js').webpack;
const UglifyJsPlugin = require('webpack/lib/optimize/UglifyJsPlugin');
const ngtools = require('@ngtools/webpack');
const CompressionPlugin = require("compression-webpack-plugin");
const ServiceWorkerWebpackPlugin = require('serviceworker-webpack-plugin');
const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin')
const buildTime = Date.now()
const ClosureCompilerPlugin = require('webpack-closure-compiler');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const AngularServiceWorkerPlugin = require('@angular/service-worker/webpack').default;
console.log(AngularServiceWorkerPlugin)
const config = {
    context: path.join(__dirname + '/src'),
    entry: {
        'polyfills': './polyfills.ts',
        'vendor': './vendor.ts',
        'main': './main.ts'
    },

    // enable loading modules relatively
    resolve: {
        extensions: ['.ts', '.js'],
        //   modules: [__dirname + "/src", "node_modules"]
    },

    module: {
github HelixOne / leto / webpack.config.js View on Github external
const webpack = require('webpack');
const path = require('path');
const webpackMerge = require('webpack-merge');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const LiveReloadPlugin = require('webpack-livereload-plugin');
const fs = require('fs')
var privateKey = fs.readFileSync('host.key', 'utf8');
var certificate = fs.readFileSync('host.crt', 'utf8');
var credentials = { key: privateKey, cert: certificate };
//const ServiceWorkerWebpackPlugin = require('serviceworker-webpack-plugin');
const AngularServiceWorkerPlugin = require('@angular/service-worker/webpack').default;
console.log(AngularServiceWorkerPlugin)

// Webpack Config
var webpackConfig = {
  context: path.join(__dirname + '/src'),

  entry: {
    'polyfills': './polyfills.ts',
    'vendor': './vendor.ts',
    'main': './main.ts',
  },

  output: {
    publicPath: '',
    path: path.resolve(__dirname, './dist/www'),
  },