aurelia / validatejs

Enables expressive validation using decorators and/or a fluent API.
MIT License
22 stars 23 forks source link

Getting cannot find module 'aurelia-validatejs' with webpack #65

Closed da1z closed 8 years ago

da1z commented 8 years ago

hello

i have done npm install aurelia-validatejs --save added aurelia-validatejs to "includeSubModules" in webpack.config added to main.ts .plugin('aurelia-validatejs')

when i am trying to import validation like this: import {Validator} from 'aurelia-validatejs' i am getting 'Cannot find module 'aurelia-validatejs'' in webpack window

Please help thanks

apawsey commented 8 years ago

You'll have to review your webpack config, it isn't a problem with aurelia-validatejs itself. Also, you don't need to add this module to the includeSubModules config. Perhaps you can post your webpack.config.js and the full error output.

da1z commented 8 years ago

var path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var AureliaWebpackPlugin = require('aurelia-webpack-plugin');
var pkg = require('./package.json');

var outputFileTemplateSuffix = '-' + pkg.version;

module.exports = {
  entry: {
    main: [
      './src/main'
    ]
  },
  output: {
    path: path.join(__dirname, 'dist'),
    filename: '[name]' + outputFileTemplateSuffix + '.js',
    chunkFilename: '[id]' + outputFileTemplateSuffix + '.js'
  },
  plugins: [
    new AureliaWebpackPlugin({
        includeSubModules: [{moduleId: 'aurelia-validatejs'}]
    }),
    new HtmlWebpackPlugin({
      title: 'Aurelia webpack skeleton - ' + pkg.version,
      template: 'index.prod.html',
      filename: 'index.html'
    })
  ],
  resolve: {
    root: [
      path.resolve('./')
    ]
  },
  module: {
    loaders: [
      { test: /\.ts$/, loader: 'tsloader' },
      { test: /\.css?$/, loader: 'style!css' },
      { test: /\.html$/, loader: 'raw' },
      { test: /\.(png|gif|jpg)$/, loader: 'url-loader?limit=8192' },
      { test: /\.woff2(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'url-loader?limit=10000&minetype=application/font-woff2' },
      { test: /\.woff(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'url-loader?limit=10000&minetype=application/font-woff' },
      { test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'file-loader' }
    ]
  }
};

Error is :"error TS2307: Cannot find module 'aurelia-validatejs'"

plwalters commented 8 years ago

This is not a webpack issue but missing typedocs - duplicate - https://github.com/aurelia/validatejs/issues/10