diff --git a/package.json b/package.json index db1cda7..4519c0f 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,9 @@ "repository": "https://git.lahouze.org/xals/accountant", "license": "AGPL-1.0", "devDependencies": { + "@types/requirejs": "^2.1.31", + "angular2-template-loader": "^0.6.2", + "awesome-typescript-loader": "^3.2.3", "babel-core": "^6.26.0", "babel-eslint": "^8.0.1", "babel-loader": "^7.1.2", diff --git a/webpack.config.js b/webpack.config.js index 0d94792..ccc7799 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -2,6 +2,7 @@ const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const webpack = require('webpack'); +const helpers = require('./config/helpers'); module.exports = { context: path.resolve(__dirname, 'src'), @@ -15,7 +16,7 @@ module.exports = { }, devtool: 'source-map', resolve: { - extensions: ['.js', '.jsx', '.ts', '.tsx', '.html'], + extensions: ['.js', '.ts', '.html'], }, module: { rules: [{ @@ -37,7 +38,7 @@ module.exports = { }, { // Javascript enforce: 'pre', - test: /\.jsx?$/, + test: /\.js$/, //include: path.resolve(__dirname, 'src'), loader: 'eslint-loader', options: { @@ -60,13 +61,13 @@ module.exports = { ] }, }, { - test: /\.jsx?$/, + test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' }, { // Typescript linting enforce: 'pre', - test: /\.tsx?$/, + test: /\.ts$/, loader: 'tslint-loader', options: { configuration: { @@ -87,31 +88,21 @@ module.exports = { formattersDirectory: 'node_modules/tslint/lib/formatters/', } }, { - test: /\.tsx?$/, + test: /\.ts$/, exclude: /node_modules/, - loader: 'ts-loader' + loaders: ['awesome-typescript-loader', 'angular2-template-loader?keepUrl=true'] }, { test: /\.html$/, - use: [ - 'ngtemplate-loader?relativeTo=/accountant-ui/src', - 'html-loader' - ] - }, { - test: /\.less$/, - use: [ - 'style-loader', - 'css-loader', - 'less-loader', - ] + loader: 'raw-loader' }, { test: /\.css$/, - use: [ + loaders: [ 'style-loader', 'css-loader', ] }, { test: /\.scss$/, - use: [ + loaders: [ 'style-loader', 'css-loader', 'sass-loader',