How to use glob-all - 10 common examples

To help you get started, we’ve selected a few glob-all 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 eden-js / cli / lib / bundles / serviceworker / tasks / serviceworker.js View on Github external
run (files) {
    // Create javascript array
    let entries = glob.sync(files);

    // Browserfiy javascript
    return browserify({
      'entries' : entries,
      'paths'   : [
        './',
        './app/bundles',
        './lib/bundles',
        './node_modules'
      ]
    })
      .transform(babelify)
      .bundle()
      .pipe(source('sw.js'))
      .pipe(buffer())
      .pipe(sourcemaps.init({
github nystudio107 / annotated-webpack-4-config / webpack.prod.js View on Github external
const configurePurgeCss = () => {
    let paths = [];
    // Configure whitelist paths
    for (const [key, value] of Object.entries(settings.purgeCssConfig.paths)) {
        paths.push(path.join(__dirname, value));
    }

    return {
        paths: glob.sync(paths),
        whitelist: WhitelisterPlugin(settings.purgeCssConfig.whitelist),
        whitelistPatterns: settings.purgeCssConfig.whitelistPatterns,
        extractors: [
            {
                extractor: TailwindExtractor,
                extensions: settings.purgeCssConfig.extensions
            }
        ]
    };
};
github ArkEcosystem / explorer / build / webpack.prod.conf.js View on Github external
...{ROUTER_MODE: `"${routerMode}"`},
          ...{TITLE: `"${networkConfig.title}"`}
        },
        GIT_VERSION: JSON.stringify(gitRevision.version),
        GIT_DATE: JSON.stringify(gitRevision.date)
      }),
      new MiniCssExtractPlugin({
        // Options similar to the same options in webpackOptions.output
        // both options are optional
        filename: utils.assetsPath('css/[name].[contenthash].css'),
        chunkFilename: '[id].css'
      }),
      // Remove unused CSS using purgecss. See https://github.com/FullHuman/purgecss
      // for more information about purgecss.
      new PurgecssPlugin({
        paths: glob.sync([
          path.join(__dirname, './../index.html'),
          path.join(__dirname, './../**/*.vue'),
          path.join(__dirname, './../src/**/*.js')
        ]),
        whitelist: [
          'border-theme-page-background',
          'table-component__th--sort-asc', 'table-component__th--sort-desc',
          'tooltip', 'tooltip-inner', 'tooltip-arrow',
          'tr', 'td',
          'v-spinner'
        ],
        whitelistPatterns: [
          /^tooltip-bg-/
        ],
        extractors: [{
          extractor: TailwindExtractor,
github SamsungInternet / snapwat / build.js View on Github external
load(id) {
      if (id === options.id) {
        // Pass in relative filepaths to glob, then convert to appropriate URLs
        const files = glob.sync(options.patterns)
          .map(file => file.replace('public/', '/'));
        return `export default ${JSON.stringify(files)};`;
      }
    }
  }
github TerriaJS / terriajs / buildprocess / webpack.config.make.js View on Github external
module.exports = function(hot, dev) {
    var config = {
        entry: glob.sync(testGlob),
        output: {
            path: path.resolve(__dirname, '..', 'wwwroot', 'build'),
            filename: 'TerriaJS-specs.js',
            publicPath: 'build/'
        },
        devtool: 'source-map',
        module: {
            loaders: [
                {
                    // Don't let jasmine-ajax detect require and import jasmine-core, because we bring
                    // in Jasmine via a script tag instead.
                    test: require.resolve('terriajs-jasmine-ajax'),
                    loader: 'imports-loader?require=>false'
                }
            ]
        },
github fians / situs / src / dir.js View on Github external
function fileList(sourceDir, ignoreList, callback) {

    // Set pattern
    var patterns = ['**/*.*'];

    lodash.forEach(ignoreList, function(item) {
        patterns.push('!'+path.normalize(item));
    });

    // Glob the files
    var files = glob.sync(patterns, {
        cwd: path.resolve(process.cwd(), sourceDir),
    });

    // Filter file only
    files = lodash.filter(files, function(item) {
        var filePath = path.resolve(process.cwd(), sourceDir+'/'+item);

        if (!fs.existsSync(filePath)) {
            return false;
        }

        return fs.lstatSync(filePath).isFile();
    });

    return callback(files);
}
github funkybob / serverless-s3-deploy / index.js View on Github external
return BbPromise.each(assets.files, (opt) => {
                this.log(`Sync bucket: ${bucket}:${prefix}`);
                this.log(`Path: ${opt.source}`);

                const cfg = Object.assign({}, globOpts, { cwd: opt.source });
                const filenames = glob.sync(opt.globs, cfg);
                return BbPromise.each(filenames, (filename) => {
                  const body = fs.readFileSync(path.join(opt.source, filename));
                  const type = mime.lookup(filename) || opt.defaultContentType || 'application/octet-stream';

                  this.log(`\tFile:  ${filename} (${type})`);

                  // when using windows path join resolves to backslashes, but s3 is expecting a slash
                  // therefore replace all backslashes with slashes
                  const key = path
                    .join(prefix, filename)
                    .replace(/\\/g, '/');

                  const details = Object.assign(
                    {
                      ACL: assets.acl || 'private',
                      Body: body,
github absolunet / nwayo / packages / workflow / helpers / flow.js View on Github external
watchSequence(name, patterns, sequence) {
		__.activeGuards[name] = 0;
		__.ignoredChanges[name] = 0;

		// Can't trust chokidar to do globbing
		const files = globAll.sync(patterns);

		return gulp.watch(files, { queue: false }, gulp.series(sequence, (callback) => {

			// Log watcher as completed
			logGuard(END, name);
			__.activeGuards[name] = 0;
			__.ignoredChanges[name] = 0;

			// When there is no more running watchers
			let anyGuardLeft = false;
			Object.keys(__.activeGuards).forEach((key) => {
				if (__.activeGuards[key]) {
					anyGuardLeft = true;
				}
			});
github BadgeLabs / mocha-eslint / index.js View on Github external
mochaInterface.describe(contextName, function () {
    globAll.sync(patterns).forEach(function (file) {
      test(file, options);
    });
  });
};
github pinoox / pinoox / apps / com_pinoox_installer / theme / magic / webpack.config.js View on Github external
'@': path.resolve(__dirname, 'assets')
        }
    },
};

if (isRelease) {
    module.exports.plugins.push(new Manifest('manifest.json'));

    module.exports.plugins.push(
        new WebpackCleanPlugin({
            on: "emit",
            path: ['./dist']
        }));

    module.exports.plugins.push(new PurifyCSSPlugin({
        paths: glob_all.sync([
            path.join(__dirname, '**/*.php'),
            path.join(__dirname, 'assets/js/**/*.js'),
            path.join(__dirname, 'assets/vue/**/*.vue'),
            path.join(__dirname, 'node_modules/simplebar/**/*.js'),
        ]),
        whitelist: [
            'rtl',
            'ltr'
        ],
    }));
}

glob-all

Provide multiple patterns to node-glob

MIT
Latest version published 1 year ago

Package Health Score

47 / 100
Full package analysis

Popular glob-all functions