8000 Split out webpack config. · StudyForFun/js-data@63e756d · GitHub
[go: up one dir, main page]

Skip to content

Commit 63e756d

Browse files
committed
Split out webpack config.
1 parent 81ea568 commit 63e756d

File tree

3 files changed

+38
-35
lines changed

3 files changed

+38
-35
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
##### 2.0.0-rc.1 - xx June 2015
1+
##### 2.0.0-rc.1 - 27 June 2015
22

33
###### Breaking API changes
44
- Moved the `getEndpoint` method to the http adapter

Gruntfile.js

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,7 @@ module.exports = function (grunt) {
1616
});
1717
require('time-grunt')(grunt);
1818

19-
var webpack = require('webpack');
2019
var pkg = grunt.file.readJSON('package.json');
21-
var banner = 'js-data\n' +
22-
'@version ' + pkg.version + ' - Homepage <http://www.js-data.io/>\n' +
23-
'@author Jason Dobry <jason.dobry@gmail.com>\n' +
24-
'@copyright (c) 2014-2015 Jason Dobry \n' +
25-
'@license MIT <https://github.com/js-data/js-data/blob/master/LICENSE>\n' +
26-
'\n' +
27-
'@overview Robust framework-agnostic data store.';
2820

2921
// Project configuration.
3022
grunt.initConfig({
@@ -68,30 +60,7 @@ module.exports = function (grunt) {
6860
}
6961
},
7062
webpack: {
71-
dist: {
72-
debug: true,
73-
entry: './src/index.js',
74-
output: {
75-
filename: './dist/js-data-debug.js',
76-
libraryTarget: 'umd',
77-
library: 'JSData'
78-
},
79-
module: {
80-
loaders: [
81-
{ test: /(src)(.+)\.js$/, exclude: /node_modules/, loader: 'babel-loader?blacklist=useStrict&modules=commonStrict' }
82-
],
83-
preLoaders: [
84-
{
85-
test: /(src)(.+)\.js$|(test)(.+)\.js$/, // include .js files
86-
exclude: /node_modules/, // exclude any and all files in the node_modules folder
87-
loader: "jshint-loader?failOnHint=true"
88-
}
89-
]
90-
},
91-
plugins: [
92-
new webpack.BannerPlugin(banner)
93-
]
94-
}
63+
dist: require('./webpack.config.js')
9564
},
9665
karma: {
9766
options: {
@@ -111,8 +80,8 @@ module.exports = function (grunt) {
11180
files: [
11281
'node_modules/es6-promise/dist/es6-promise.js',
11382
'dist/js-data.min.js',
114-
'node_modules/js-data-http/dist/js-data-http.js',
115-
'node_modules/js-data-localstorage/dist/js-data-localstorage.js',
83+
'bower_components/js-data-http/dist/js-data-http.js',
84+
'bower_components/js-data-localstorage/dist/js-data-localstorage.js',
11685
'karma.start.js',
11786
'test/both/**/*.js',
11887
'test/browser/**/*.js'

webpack.config.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
var webpack = require('webpack');
2+
var pkg = JSON.parse(require('fs').readFileSync('package.json'));
3+
var banner = 'js-data\n' +
4+
'@version ' + pkg.version + ' - Homepage <http://www.js-data.io/>\n' +
5+
'@author Jason Dobry <jason.dobry@gmail.com>\n' +
6+
'@copyright (c) 2014-2015 Jason Dobry \n' +
7+
'@license MIT <https://github.com/js-data/js-data/blob/master/LICENSE>\n' +
8+
'\n' +
9+
'@overview Robust framework-agnostic data store.';
10+
11+
module.exports = {
12+
debug: true,
13+
entry: './src/index.js',
14+
output: {
15+
filename: './dist/js-data-debug.js',
16+
libraryTarget: 'umd',
17+
library: 'JSData'
18+
},
19+
module: {
20+
loaders: [
21+
{ test: /(src)(.+)\.js$/, exclude: /node_modules/, loader: 'babel-loader?blacklist=useStrict&modules=commonStrict' }
22+
],
23+
preLoaders: [
24+
{
25+
test: /(src)(.+)\.js$|(test)(.+)\.js$/, // include .js files
26+
exclude: /node_modules/, // exclude any and all files in the node_modules folder
27+
loader: "jshint-loader?failOnHint=true"
28+
}
29+
]
30+
},
31+
plugins: [
32+
new webpack.BannerPlugin(banner)
33+
]
34+
};

0 commit comments

Comments
 (0)
0