-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from hegrec/webpack
MERC-409: Utilize standard import style
- Loading branch information
Showing
23 changed files
with
195 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
node_modules/ | ||
jspm_packages/ | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,44 @@ | ||
var Jspm = require('jspm'); | ||
var Fs = require('fs'); | ||
var Path = require('path'); | ||
var config = require('../webpack.conf.js'); | ||
var webpack = require('webpack'); | ||
var options = { | ||
entry: 'src/main', | ||
dist: 'dist/stencil-utils.min.js', | ||
minify: true, | ||
sourceMaps: false | ||
entry: './src/main.js', | ||
output: { | ||
path: Path.resolve(__dirname, '../dist'), | ||
filename: 'stencil-utils.min.js', | ||
library: ['stencilUtils'] | ||
}, | ||
devtool: false | ||
}; | ||
|
||
module.exports = function(grunt) { | ||
grunt.registerTask('build', 'Builds a self executing bundle with JSPM', function() { | ||
grunt.registerTask('build', 'Builds a distributable bundle of stencil utils', function() { | ||
var done = this.async(); | ||
try{ | ||
Fs.statSync(Path.join(process.cwd(), 'jspm_packages')); | ||
} catch(err) { | ||
grunt.fail.fatal('Folder "jspm_packages" does not exist. Please run "jspm install" first'); | ||
} | ||
var compiler; | ||
|
||
// Don't include source maps for a distributable package | ||
config.devtool = options.devtool; | ||
config.entry = options.entry; | ||
config.output = options.output; | ||
config.plugins = [ | ||
new webpack.optimize.UglifyJsPlugin({ | ||
output: { | ||
comments: false | ||
} | ||
}) | ||
]; | ||
|
||
compiler = webpack(config); | ||
|
||
compiler.run(function(err, stats) { | ||
if (err) { | ||
throw err; | ||
} | ||
|
||
console.log('Distributable bundle created at: ' + Path.join(options.output.path, options.output.filename)); | ||
|
||
Jspm.setPackagePath(process.cwd()); | ||
Jspm.bundleSFX(options.entry, options.dist, {minify: options.minify, sourceMaps: options.sourceMaps}).then(function () { | ||
done(); | ||
}).catch(function(err, param2) { | ||
grunt.fail.fatal(err); | ||
}); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,34 @@ | ||
{ | ||
"name": "@bigcommerce/stencil-utils", | ||
"version": "0.4.0", | ||
"main": "dist/stencil-utils.min.js", | ||
"main": "src/main.js", | ||
"license": "BSD-4-Clause", | ||
"author": "Bigcommerce", | ||
"jspm": { | ||
"main": "main", | ||
"directories": { | ||
"lib": "src" | ||
}, | ||
"dependencies": { | ||
"asyncly/EventEmitter2": "github:asyncly/[email protected]", | ||
"jquery": "github:components/[email protected]" | ||
}, | ||
"devDependencies": { | ||
"babel": "npm:[email protected]", | ||
"babel-runtime": "npm:[email protected]", | ||
"core-js": "npm:[email protected]" | ||
} | ||
}, | ||
"devDependencies": { | ||
"babel-core": "6.5.2", | ||
"babel-eslint": "4.1.0", | ||
"es6-shim": "0.28.1", | ||
"eslint": "1.9.0", | ||
"eslint-config-airbnb": "1.0.0", | ||
"babel-loader": "6.2.4", | ||
"babel-preset-es2015": "^6.6.0", | ||
"es6-shim": "^0.35.0", | ||
"eslint": "2.4.0", | ||
"eslint-config-airbnb": "6.0.2", | ||
"eventemitter2": "^0.4.14", | ||
"grunt": "0.4.5", | ||
"grunt-eslint": "17.3.1", | ||
"grunt-karma": "0.12.0", | ||
"grunt-eslint": "18.0.0", | ||
"grunt-karma": "0.12.2", | ||
"jasmine-core": "2.2.0", | ||
"jspm": "0.16.15", | ||
"karma": "0.13.9", | ||
"karma-babel-preprocessor": "5.2.1", | ||
"karma-chrome-launcher": "0.1.7", | ||
"jquery": "^2.2.1", | ||
"karma": "0.13.22", | ||
"karma-babel-preprocessor": "6.0.1", | ||
"karma-coverage": "0.2.7", | ||
"karma-es6-shim": "0.1.3", | ||
"karma-jasmine": "0.3.5", | ||
"karma-jspm": "2.0.2", | ||
"karma-phantomjs2-launcher": "0.3.2", | ||
"karma-es6-shim": "^0.2.3", | ||
"karma-jasmine": "^0.3.7", | ||
"karma-phantomjs-launcher": "1.0.0", | ||
"karma-sourcemap-loader": "^0.3.7", | ||
"karma-verbose-reporter": "0.0.2", | ||
"karma-webpack": "^1.7.0", | ||
"load-grunt-config": "0.17.1", | ||
"time-grunt": "1.2.2" | ||
"time-grunt": "1.2.2", | ||
"webpack": "^1.12.14" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.