npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

grunt-concat-seajs

v1.0.24

Published

If you combine a seajs project file, this task can be used with the seajs module to load the corresponding

Downloads

7

Readme

grunt-concat-seajs

If you combine a seajs project file, this task can be used with the seajs module to load the corresponding.

Getting Started

This plugin requires Grunt ~0.4.5

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-concat-seajs --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-concat-seajs');

The "concat_seajs" task

Overview

In your project's Gruntfile, add a section named concat_seajs to the data object passed into grunt.initConfig().

grunt.initConfig({
  concat_seajs: {
    options: {
      // Task-specific options go here.
    }
  },
});

Options

baseDir

Type: String

Building the project then generate the destination path, fllowing this path is to find the file content for injecting the aim files.

seajs_src

Type: String

The path of seajs file is used to be the path of the match file.

map_file_name

Type: String Default: fetch.js

This is the seajs fetch file name.

cdnBase

Type: String

If you static source put on the cdn service before you publish your project,you should config this param.

injectFetch

Type: Boolean Default: false

Turns on injectFetch of the generated source code. the seajs fetch file will inject to the views which you config.

injectSea

Type: Boolean Default: false

Turns on injectFetch of the generated source code. the seajs file will inject to the views which you config.

map

Type: Array Default: [] Param: dest , files

If you want to inject different js/css for individual pages, you can use this property,Any page can be configured individually.

Usage Examples

Custom Options

In this example, custom options are used to do something else with whatever else. So if the concat config concat the files and filerev make files md5, the generated result would be genarate a match file in seajs_src. At the same time, the match file would be insert to the view_src.

grunt.initConfig({
  concat_seajs: {
    options: {
            map_file_name: 'fetch.js',
            seajs_src: '',
            cdnBase: 'http://s.geilicdn.com/',
            baseDir: 'dist/',
            injectFetch: true,
            injectSea: true,
            map: [{
                      'dest': path.join(config.releaseDir ,'pages/index.html'),
                      'files': [
                          path.join(config.releaseDir , 'js/common.min.js'),
                          path.join(config.releaseDir , 'js/index.min.js')
                      ]
                  }]
    }
  },
});

The most Important part

This is a very critical step!Please pay attention to this step. It's will need you to do some simple configuration in your pages: You have to separate the seajs.config part and the seajs.use part to two different . And ensure that reference should be follow this order.

<script src="js/base/sea.js"></script>
<script type="text/javascript" data-seajs-config="true">
    seajs.config({
        base: '',
        charset : 'utf-8'
    });
</script>
<script type="text/javascript">
    seajs.use('js/index',function(index){
        index.init();
        ...
    });
</script>```

## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).

## Release History
- 2016 11.24   -v1.0.22   -Bug fixed. Fix problems caused by htmlmin plugin.
- 2016 10.11   -v1.0.19   -Bug fixed. Fix fetch map absolute path bug.
- 2016 9.20   -v1.0.16   -Support part of file inject to the pages & process the fetch map.
- 2016 9.7   -v1.0.15   -Add fethc map filter ,static files do not appear to the fetch map.
  eg: .jpg|.bmp|.gif|.png|.map|.css|.eot|.svg|.ttf|.woff
- 2016 9.2   -v1.0.13   -Fix no concat file fetch error bug,and Update readme.md.
- 2016 8.30   -v1.0.12   -Fix get filerev map bug, and add inject fetch/seajs file into pages feature.