diff --git a/packages/cycle-scripts/configs/tsconfig.json b/packages/cycle-scripts/configs/tsconfig.json new file mode 100644 index 0000000..2b4e47b --- /dev/null +++ b/packages/cycle-scripts/configs/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compileOnSave": false, + "compilerOptions": + { + "module": "ES6", + "moduleResolution": "node", + "sourceMap": true, + "jsx" : "preserve", + "target": "ES6" + }, + "exclude": [ + "node_modules" + ] +} diff --git a/packages/cycle-scripts/configs/webpack.config.js b/packages/cycle-scripts/configs/webpack.config.js index e7e2017..84407d8 100644 --- a/packages/cycle-scripts/configs/webpack.config.js +++ b/packages/cycle-scripts/configs/webpack.config.js @@ -6,7 +6,7 @@ process.noDeprecation = true const webpack2Block = require('@webpack-blocks/webpack2'); const createConfig = webpack2Block.createConfig -const defineConstants = webpack2Block.defineConstant +const defineConstants = webpack2Block.defineConstants const env = webpack2Block.env const entryPoint = webpack2Block.entryPoint const setOutput = webpack2Block.setOutput @@ -51,11 +51,11 @@ const babelConfig = { } module.exports = function(language) { - const ending = language === 'javascript' ? 'js' : 'ts' + const ending = language === 'javascript' ? '.js' : '.ts' const baseConfig = [ entryPoint(path.join(process.cwd(), 'src', 'index' + ending)), setOutput(path.join(process.cwd(), 'build', 'bundle.[hash].js')), - babel(), + babel(babelConfig), defineConstants({ 'process.env.NODE_ENV': process.env.NODE_ENV }), @@ -85,8 +85,9 @@ module.exports = function(language) { const config = language === 'javascript' ? baseConfig : baseConfig .concat([ typescript({ + tsconfig: path.join(__dirname, 'tsconfig.json'), useBabel: true, - babelOptions: baseConfig, + babelOptions: babelConfig, useCache: true, cacheDirectory: 'node_modules/.cache/at-loader' }), diff --git a/packages/cycle-scripts/index.js b/packages/cycle-scripts/index.js old mode 100644 new mode 100755 diff --git a/packages/cycle-scripts/scripts/start.js b/packages/cycle-scripts/scripts/start.js index e05d764..ec71252 100644 --- a/packages/cycle-scripts/scripts/start.js +++ b/packages/cycle-scripts/scripts/start.js @@ -69,7 +69,7 @@ function run (port) { } ) - const devServer = new WebpackDevServer(compiler, devServerConfig) + const devServer = new WebpackDevServer(compiler) devServer.listen(port, err => { if (err) {