tactivos / grunt-cdn

79 stars 53 forks source link

getting `cannot read property 'start' of undefined` when running grunt-cdn #70

Open tconroy opened 9 years ago

tconroy commented 9 years ago

Hey,

I may not have the plugin configured properly, so coming here for some advice.

My app directory is structured like so:

project/
    app/
    dist/
        scripts/
            - main.js
        styles/
            - main.css
        - index.html

I need to have the reference to dist/scripts/main.js & dist/styles/main.css inside of dist/index.html point to a CDN URL.

Here is my grunt-cdn config:

        cdn: {
            options: {
                cdn: '//www.my-cdn-url.com/',
                flatten: true,
                supportedTypes: {'js':'js'}
            },
            distCSS: {
                cwd: './dist/styles/',
                dest: './dist/styles/',
                src: ['./dist/index.html', '*.*.css']
            },
            distJS: {
                cwd: './dist/scripts/',
                dest: './dist/scripts/',
                src: ['./dist/index.html', '*.*.js']
            }
        }

css inside dist/index.html should point to: //www.my-cdn-url.com/styles/main.css js inside dist/index.html should point to: //www.my-cdn-url.com/scripts/main.js

when I run the above I get the error: Warning: Cannot read property 'start' of undefined Use --force to continue.