@@ -3,58 +3,77 @@ const conf = require('./gulp.conf');
33const path = require ( 'path' ) ;
44
55const HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
6- const SplitByPathPlugin = require ( 'webpack-split-by-path' ) ;
7- const ExtractTextPlugin = require ( "extract-text-webpack-plugin" ) ;
6+ const FailPlugin = require ( 'webpack-fail-plugin' ) ;
7+ const ExtractTextPlugin = require ( 'extract-text-webpack-plugin' ) ;
8+ const pkg = require ( '../package.json' ) ;
89const autoprefixer = require ( 'autoprefixer' ) ;
910var DeclarationBundlerPlugin = require ( 'declaration-bundler-webpack-plugin' ) ;
1011
1112module . exports = {
12- module : {
13- // https://github.com/localForage/localForage#browserify-and-webpack
14- noParse : / n o d e _ m o d u l e s \/ l o c a l f o r a g e \/ d i s t \/ l o c a l f o r a g e .j s / ,
13+ module : {
14+ // https://github.com/localForage/localForage#browserify-and-webpack
15+ noParse : / n o d e _ m o d u l e s \/ l o c a l f o r a g e \/ d i s t \/ l o c a l f o r a g e .j s / ,
1516
17+ loaders : [
18+ {
19+ test : / \. j s o n $ / ,
1620 loaders : [
17- {
18- test : / \. t s $ / ,
19- exclude : / n o d e _ m o d u l e s / ,
20- loaders : [
21- 'ng-annotate' ,
22- 'ts'
23- ]
24- }
21+ 'json-loader'
2522 ]
26- } ,
27- plugins : [
28- new webpack . optimize . OccurrenceOrderPlugin ( ) ,
29- new webpack . NoErrorsPlugin ( )
30- // new webpack.optimize.UglifyJsPlugin({
31- // compress: {unused: true, dead_code: true} // eslint-disable-line camelcase
32- // })
33- ] ,
34- output : {
35- // https://webpack.github.io/docs/library-and-externals.html
36- path : path . join ( process . cwd ( ) , conf . paths . dist ) ,
37- library : 'Jsonapi' ,
38- libraryTarget : 'commonjs' ,
39- filename : 'ts-angular-jsonapi.js'
40- } ,
41- externals : {
42- 'angular' : 'angular'
43- } ,
44- resolve : {
45- extensions : [
46- '' ,
47- '.webpack.js' ,
48- '.web.js' ,
49- '.js' ,
50- '.ts'
23+ } ,
24+ {
25+ test : / \. t s $ / ,
26+ exclude : / n o d e _ m o d u l e s / ,
27+ loader : 'tslint-loader' ,
28+ enforce : 'pre'
29+ } ,
30+ {
31+ test : / \. ( c s s | s c s s ) $ / ,
32+ loaders : ExtractTextPlugin . extract ( {
33+ fallback : 'style-loader' ,
34+ use : 'css-loader?minimize!sass-loader!postcss-loader'
35+ } )
36+ } ,
37+ {
38+ test : / \. t s $ / ,
39+ exclude : / n o d e _ m o d u l e s / ,
40+ loaders : [
41+ 'ng-annotate-loader' ,
42+ 'ts-loader'
43+ ]
44+ } ,
45+ {
46+ test : / \. h t m l $ / ,
47+ loaders : [
48+ 'html-loader'
5149 ]
52- } ,
53- entry : `./${ conf . path . srcdist ( 'index.ts' ) } ` ,
54- ts : {
55- configFileName : 'tsconfig.json'
56- } ,
57- tslint : {
58- configuration : require ( '../tslint.json' )
59- }
50+ }
51+ ]
52+ } ,
53+ plugins : [
54+ new webpack . optimize . OccurrenceOrderPlugin ( ) ,
55+ new webpack . NoErrorsPlugin ( )
56+ // new webpack.optimize.UglifyJsPlugin({
57+ // compress: {unused: true, dead_code: true} // eslint-disable-line camelcase
58+ // })
59+ ] ,
60+ output : {
61+ // https://webpack.github.io/docs/library-and-externals.html
62+ path : path . join ( process . cwd ( ) , conf . paths . dist ) ,
63+ library : 'Jsonapi' ,
64+ libraryTarget : 'commonjs' ,
65+ filename : 'ts-angular-jsonapi.js'
66+ } ,
67+ externals : {
68+ 'angular' : 'angular'
69+ } ,
70+ resolve : {
71+ extensions : [
72+ '.webpack.js' ,
73+ '.web.js' ,
74+ '.js' ,
75+ '.ts'
76+ ]
77+ } ,
78+ entry : `./${ conf . path . srcdist ( 'index.ts' ) } `
6079} ;
0 commit comments